We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1739ed3 commit 78ae781Copy full SHA for 78ae781
find-minimum-in-rotated-sorted-array/daiyongg-kim.py
@@ -0,0 +1,14 @@
1
+class Solution:
2
+ def findMin(self, nums: List[int]) -> int:
3
+ #constraint complexity: O(log n)
4
+ left = 0
5
+ right = len(nums) - 1
6
+
7
+ while left < right:
8
+ mid = (left + right) // 2
9
10
+ if nums[mid] < nums[right]:
11
+ right = mid
12
+ else:
13
+ left = mid + 1
14
+ return nums[left]
0 commit comments