O74

Find Minimum in Rotated Sorted Array

Junior Level Candidate
Target Time: 15 - 20 Minutes
Type: NUMERIC

Problem Statement & Objective

Given the sorted rotated array nums of unique elements, return the minimum element of this array in O(log n) time.

Function Signature (Python)

find_min_rotated_array(nums: list[int]) -> int

Input & Output Contract

Output Rule:Minimum eleman tam sayısı.

System Constraints

1 <= sayilar.length <= 10^5
-5000 <= sayilar[i] <= 5000
Tüm sayılar benzersizdir

Example Execution Walkthrough

sayilar = [3, 4, 5, 1, 2] -> minimum: 1
sayilar = [4, 5, 6, 7, 0, 1, 2] -> minimum: 0
sayilar = [11, 13, 15, 17] -> minimum: 11

Example Test Scenarios (3)

Example 1
Input:[[3,4,5,1,2]]
Expected Output:1
Example 2
Input:[[4,5,6,7,0,1,2]]
Expected Output:0
Example 3: Döndürülmemiş
Input:[[11,13,15,17]]
Expected Output:11
Loading Python Editor...
Input Parameters
[
  [
    3,
    4,
    5,
    1,
    2
  ]
]
Expected Output
1