TLE in Pivot of Sorted and Rotated Array

The following code is giving TLE in hackerblocks upon submission.
https://ide.codingblocks.com/s/63896

Please Help!!!

you are not using Binary Search properly.
Complexity Needed -O(log n)
Your code complexity - TLE cozz infinite loop main jaa raha … By chance Sample test case worked
Hey Harshita ,
you are doing like
s=mid+1 and e=mid-1
bt u never changed the value of mid and it is taking again and again same value.
Wrong test case :slight_smile:
5
5 1 2 3 4
Output :slight_smile:
Andha time …Infinite loop

You can refer prateek bhaiya’s video. It will help u to solve it


Hit like if u get it :slight_smile:

1 Like

Thank You so much!!!