Deepak and his journey

Question link -
https://hack.codingblocks.com/contests/c/588/1012
Solution link -


None of the test cases are passing

Able to rectify the error on own.