334. Increasing Triplet Subsequence

class Solution(object):
    def increasingTriplet(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        a,b,min=float("inf"),float("inf"),float("inf")
        for c in nums:
            if min>=c:
                min=c
            elif b>=c:
                a,b=min,c
            else:
                return True
        return False
            

你可能感兴趣的:(334. Increasing Triplet Subsequence)