Help me here, got stuck

https://ideone.com/5f1X47. this code is passing only 1 test case…please check it out

@aryan
hey u have some minor issue
refer to this code here