Loading...
The Rotated Array
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- senior
Problem
Our distributed index stores sorted data across shards that may be rotated at an unknown pivot. Write a function called search_rotated that finds a target in such a rotated sorted array in O(log n) time, returning its index or -1 if absent.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.