Possible solutions to this question ?

Revision en1, by guesshere, 2023-09-22 16:41:58

You are given an array of positive numbers. You can can convert any element (i) to any value in range [i/2, i-1] or [i+1, 2*i] in one step. Mind minimum steps needed to make the all elements equal.

1 <= n <= 1e5

Each element in range [1,1e5]

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English guesshere 2023-09-22 16:41:58 284 Initial revision (published)