https://ide.codingblocks.com/s/225294.
Please help me to rectify my code.
@saswat1908
Consider this testcase
2
5 5
output should be 0 but your code is printing 5.
there is mistake in line 22, change it to if(steps[i]>=steps[j]) . You are also adding equal numbers to your ans.