Arrays-Binary Search

Why my code gives wrong answer for testcase 1 and testcase 3 ?

Vaishnavi, I have edited your code now, I have used normal approach instead of recursive approach…