Binary Search TLE Error

why is there a TLE since complexity for binary search is O(logn)?
Link to code : https://ide.codingblocks.com/s/200320

Hi @Chirag-Jain-1414278322030453 the formula for mid in line 6 should be mid = left + (right - left) / 2 you have made a typo there and typed 1 instead of l