Help rahul to search

i tried doing the code with the iterative approach but getting wrong ans can you please help me with the code.

I have edited your code, try to submit now,

sir i was able to come up with the recursive approach but i am working on the iterative approach

hello hello hello //???

Sry for late replies, actually your code is not producing correct answer for following test case.
10
6
7
8
9
0
1
2
3
4
5
0
Expected output : 4
Your output : -1