Cant Pass all test cases need some guidance

[https://ide.codingblocks.com/s/478203]
Could anyone please check the code and tell what is wrong in my code