334. Increasing Triplet Subsequence
https://leetcode.com/problems/increasing-triplet-subsequence/
Python
class Solution:
def increasingTriplet(self, nums: List[int]) -> bool:
if len(nums) < 3:
return False
maximum = max(nums)
left, mid = maximum, maximum
for num in nums:
if num <= left:
left = num
elif num <= mid:
mid = num
else:
return True
return False