DEV Community

Discussion on: Solution: Minimize Deviation in Array

Collapse
 
seanpgallivan profile image
seanpgallivan

Unfortunately, the only operation available for even numbers is to divide by two, so you wouldn't be able to multiply the first element 2 by two to get 4.

That makes the optimal result [2,5,4] or [2,5,2].