You are viewing a single comment's thread. Return to all comments →
Hi, I also used the same, but I am unable to findout correct solution if input is 1 5 5 10 10.
After first step(value-min) : 0, 4, 4, 9, 9
step required to make all zero = 0+2+2+3+3=10
but if we try to do in this way like
0, -1(4-5),-1(4-5),-1(9-2*5), -1(9-2*5) => total steps= 0+1+1+2+2; -1, -1, -1, -1, -1 => total step = 1+0+0+0+0 = 1 So total operation is 7.
Please let me know if I am doing something worng/incorrect.
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
Hi, I also used the same, but I am unable to findout correct solution if input is 1 5 5 10 10.
After first step(value-min) : 0, 4, 4, 9, 9
step required to make all zero = 0+2+2+3+3=10
but if we try to do in this way like
Please let me know if I am doing something worng/incorrect.