question= https://hack.codingblocks.com/contests/c/443/1281
solution=https://ide.codingblocks.com/#/s/17072
Answer is right but test case wrong
Heyy ! , try to do this using recursion because if you are trying with iterative way it may possible that you are missing some corner case .
https://ide.codingblocks.com/#/s/17744