First index occurence recursion

ques : https://hack.codingblocks.com/app/practice/1/526/problem

code : https://ide.codingblocks.com/s/228752

i am getting error here

hello @chaman9
image
use return before this statement

i am not getting how…
already returned before that

i mean it should be
return findFirst(arr,i+1,n,k);

yeaah i did it… now getting the correct output

can you tell me why we used that and where i was wrong

firstFind() will return some index right?

so its your job to send that return value back to the calling function. you were not doing the same.

okay got it… thanks a lot