Help in a problem.

Revision en1, by 444iq, 2019-11-24 20:54:21

You are given an array of N elements. You have to minimize the absolute difference between the max and minimum element. You can peform this operation any number of times. N can be upto 10^5. A[i] <= 10^9

The elements which are odd you can multiply it by 2. The elements which are even you can divide it by 2.


arr[] = 1 2

divide 2 by 2. array becomes 1. Now minmum difference is 1-1 = 0. How to solve this problem.


  Rev. Lang. By When Δ Comment
en1 English 444iq 2019-11-24 20:54:21 447 Initial revision (published)