Skip to content

Latest commit

 

History

History
4 lines (3 loc) · 338 Bytes

File metadata and controls

4 lines (3 loc) · 338 Bytes

I used binary search to find the pivot and once the pivot is found I used binary search again to find the target number within the subArray.

In terms of time complexity, it's O(logN) because of binary search. In terms of space complexity, it's O(1) because the it does not require extra storage space depending on the input list size.