← All problems
Search in Rotated Sorted Array
Search for a target value in a rotated sorted array (sorted ascending, then rotated at an unknown pivot) in O(log n) time. Duplicates are not present in the basic version.
Complexity
Time O(log n), Space O(1)
Common pitfalls
- Wrong half identification
- Duplicates causing O(n) unhandled
Your solution
Log in to save your code and track progress.