2018-11-06 leetcode Increasing Triplet Subsequence Increasing Triplet SubsequenceBinary Search Version - 40ms O(n) 123456789101112131415class Solution: def increasingTriplet(self, nums): """ :type nums: List[int] :rtype: bool """ first = second = float('inf') for x in nums: if x <= first: first = x elif x <= second: second = x else: return True return False test code 12345In [306]: s = Solution(); t = s.increasingTriplet(n); print(t)TrueIn [307]: nOut[307]: [1, 3, 6, 7, 9, 4, 10, 5, 6] leet code Newer Perfect Squares Older Longest Increasing Subsequence