Pivot of sorted and rotated array?

pls go through my code for this problem . it passed all the test cases. I just want to ask why is the editorial code to lengthy

@mehulbhandari358 again, binary search is much more efficient than linear search. its not about the “length” of the code, the ultimate goal is to reduce time and space complexity

from “length” i meant complexity !!

@mehulbhandari358 i havent seen the editorial code but im assuming its using the binary search approach only. Do you need help in understanding that code? If yes please share it here. If you want a comparison between the time taken by two you can even use the clock() function to see which one is faster, check it for big inputs (by big inputs i mean length of the array is large) then you will see how big a difference it actually makes.

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.