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
            

좋은 웹페이지 즐겨찾기