Given an integer array nums, sort the integers in ascending order based on their binary reflection.
The binary reflection of a positive integer is formed by taking its binary representation without leading zeros, reversing the bits, and converting the reversed binary string back to an integer.
If two or more integers share the same binary reflection value, arrange them in ascending order according to their original values.
Return the sorted array.
Note: If multiple elements have identical reflected values, their relative order is resolved by comparing their original values in ascending order.
Constraints:
nums.length
nums[i]
Given an integer array nums, sort the integers in ascending order based on their binary reflection.
The binary reflection of a positive integer is formed by taking its binary representation without leading zeros, reversing the bits, and converting the reversed binary string back to an integer.
If two or more integers share the same binary reflection value, arrange them in ascending order according to their original values.
Return the sorted array.
Note: If multiple elements have identical reflected values, their relative order is resolved by comparing their original values in ascending order.
Constraints:
nums.length
nums[i]