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 cf0eb38 commit 6e927c7Copy full SHA for 6e927c7
find-minimum-in-rotated-sorted-array/dusunax.py
@@ -0,0 +1,15 @@
1
+'''
2
+# 153. Find Minimum in Rotated Sorted Array
3
+
4
+## Time Complexity: O(n)
5
+- min() iterates through all elements to find the smallest one.
6
7
+## Space Complexity: O(1)
8
+- no extra space is used.
9
10
+class Solution:
11
+ def findMin(self, nums: List[int]) -> int:
12
+ if len(nums) == 1:
13
+ return nums[0]
14
15
+ return min(nums)
0 commit comments