Answer: Uber OA Question 2024 June | Binary Search | on-campus
Answer · Posted Jun 2026
Solution: Find Minimum in Rotated Sorted Array — Binary Search Approach A linear scan would trivially find the minimum in O(N), but the problem requires O(log N). We use Modified Binary Search. The key insight is that in a rotated sorted array, one half is always sorted. We compare nums[mid] with nums[right]: If nums[mid] > nums[right], the minimum must lie in the right half. Move left = mid + 1. Otherwise, the minimum is in the left half (including mid). ...
The full answer & interview discussion are available to premium members.
Log in Create a free account