Checking from last index

how should I do it if I want to check from the last index?

start from last index if u found element return the index else cntinue the recursion base case will be if(n < 0) return -1, finally if u get -1 means its not present else u return the index

instead of 3 i am getting 2 with this logic

also, in the method where we find from start , 1 test case is giving wrong answer

instead of 3 i am getting 2 with this logic

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.