Please read the new rule regarding the restriction on the use of AI tools. ×

Min divisions by d to equalize at least k elements in an array

Revision en2, by man.god96, 2020-05-13 22:36:06

So here's the problem -

I need to find the minimum divisions required with a divisor 'd', to equalize at least k elements in the array.

For eg. for array {64,25,33,30}, divisor=2 and k=2 ->

Divide 64 two times to get 16 and 33 one time to get 16. So array becomes {16,25,16,30} which has k=2 elements equal. And so minimum divisions required = 3.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English man.god96 2020-05-13 22:36:06 4
en1 English man.god96 2020-05-13 22:35:41 413 Initial revision (published)