The following code is giving TLE in hackerblocks upon submission.
https://ide.codingblocks.com/s/63896
Please Help!!!
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 
5
5 1 2 3 4
Output 
Andha time …Infinite loop
You can refer prateek bhaiya’s video. It will help u to solve it
Hit like if u get it 
Thank You so much!!!