As reported: Goldman Sachs Associate CoderPad round (India, 2025): Find Minimum in Rotated Sorted Array, solved with the edge cases (the other question was Trapping Rain Water).
A sorted array of distinct integers was rotated between 1 and n times. Return its minimum in O(log n) time.
This is LeetCode 153 — Find Minimum in Rotated Sorted Array.
Example 1
nums = [3,4,5,1,2]
-> 1
Example 2
nums = [4,5,6,7,0,1,2]
-> 0
Example 3
nums = [11,13,15,17]
-> 11
Constraints: 1 ≤ n ≤ 5000; values distinct, -5000 ≤ nums[i] ≤ 5000.
Code runner format: one JSON value per line: nums (LeetCode's test-case format). Implement findMin(nums); the harness prints the result as JSON.