Two testcases not passing...where its failing,..please check my code
Hello @dbhavanishankar89,
There is a mistake with your code:
You are not returning result of the subsequent recursive calls.
Then why your code is passing the sample test case?
Because for the very first call, the value of mid matches with the value of target element, thus returning the correct index.
I have modified your code, refer to the comments for better understanding:
Hope, this would help.
Give a like, if you are satisfied.