Tle in one question

Hii
This is one question i am attepting on GFG…
https://practice.geeksforgeeks.org/problems/peak-element/1

This is my code… I don’t know why this is showing tle even this is based on binary search.

Please suggest me where i am wrong

@ashishnnnnn
your code is giving TLE, because there might be a condition your code will not go into any of the if else condition and will get stuck.
Add a else condition at the end, so that even in this case it do something.