My code Implementation is right Im still getting wrong answer after submission

Can you check my code and tell me if I am messing with output or something because I tried the same code for other website and it passed all the test cases

@sumitpatil3141_67228965abbfaf85 Your code is failing testcases like :
1
6 3
12 14 16 40 90 95
Correct answer = 95
your answer = 90
Debug your code for these.

Thanks a lot sir I wasn’t checking for the case where if element was greater than the mid.

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.