class Solution(object):
def findMin(self, nums):
nums.sort()
return nums[0]
Runtime: 40 ms
Sorting only takes O(n) here. Demo:
>>> import random
>>> from timeit import timeit
>>> # Sort a rotated sorted list.
>>> a = range(3333333, 10000000) + range(3333333)
>>> timeit(a.sort, number=1)
0.11482411267604675
>>> # Sort a shuffled version of it.
>>> random.shuffle(a)
>>> timeit(a.sort, number=1)
6.308021483568041