Finding last index

One testcase failed although recursion part is correct?
Code : https://ide.codingblocks.com/s/205836

your code is actually correct.
your test case 1 is failed… I checked your code and the test case as well… the output of your code is correct and it seems that there is something wrong with testcase 1. so go ahead to solve next question.

thanks