This code is working good and passed all test cases https://ide.codingblocks.com/s/257829
but this one is also built on same logic but little bit changes in loops and not giving correct answer
https://ide.codingblocks.com/s/257829 (Please Tell correction in this code)