Last index question

why my code wont work for index n-1
question
https://hack.codingblocks.com/contests/c/512/369
my code
https://ide.codingblocks.com/s/36406

There was problem with base case in your code…

I have made correction in your code and now it passes all the test case…
https://ide.codingblocks.com/s/36550