본문 바로가기

두두의 알고리즘/문제

[이분탐색] 릿코드 153 Medium 'Find Minimum in Rotated Sorted Array' (Python)

728x90

<문제 링크>

https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/

 

Find Minimum in Rotated Sorted Array - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com


<문제 풀이>

1. 배열의 최소 요소를 반환하라고 했으므로 min 함수 사용

 

<코드>

class Solution:
    def findMin(self, nums: List[int]) -> int:
        return min(nums)