I tried two solutions for this problem, both of them are passing the sample test case but none of them is a successful solution.
All test cases failing:- https://ide.codingblocks.com/s/182821
One test case passed:- https://ide.codingblocks.com/s/182822
Can anyone tell me what am I doing wrong here ?