Problem with approach

i tried to solve it but i approached till half solved part either left or right but don’t know how to solve together with binary search

@ashish_arora369 see the image

it is not working for 2 3 4 5 1 and 1 2 3 4 5

@ashish_arora369 it is just a pseudo code . should I send you my code for reference.

no, just tell me that is it work for 1 2 3 4 5 or not?

in case of 1 2 3 4 5 it is infinite loop

hello @ashish_arora369

handle it seprately
if a[0] < a[n-1] it means complete array is sorted in that case u can say pivot is n-1.

for other cases follow what himanshu said

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.