def increasingTriplet(self, nums): L = [float('inf')] * 3 for x in nums: L[bisect.bisect_left(L, x)] = x if L < float('inf'): return True return False
Yes, if it handles
k instead of
3, need to be careful for edge cases,
if k <= 1: return True, thx!
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.