What's wrong with my code?

What’s wrong with my code?

hello @priyamthakuria27
a) initilase ur ans with -1.

b)this line should be image

ans=last_occurence_index(a, n,key,i+1,ans);

hey why u have reopened the doubt ,r u still facing any issue

no. completed. by mistake. i closed it again.

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.