You may repeatedly change any entry of the positive integer array nums: divide an even value by 2, or multiply an odd value by 2. Choose any entries and perform any number of operations, including none. The deviation is the largest array value minus the smallest. Return the smallest deviation you can achieve.
Example 1:
Input: nums = [3,6]
Output: 0Explanation: Divide 6 by 2 to obtain [3,3]. Both values are equal, so the deviation is 0.
Example 2:
Input: nums = [3,5]
Output: 1Explanation: The first entry can be 3 or 6, and the second can be 5 or 10. Choosing [6,5] gives deviation 1, the smallest possible.
Example 3:
Input: nums = [8,4,2]
Output: 0Explanation: Divide 8 by 2 twice and divide 4 by 2 once. The array becomes [2,2,2], with deviation 0.
Constraints:
2 <= nums.length <= 500001 <= nums[i] <= 1000000000