[LeetCode][Python3] 334. Increasing Triplet Subsequence
2019. 3. 25. 01:04 |
프로그래밍/LeetCode
Problem :
https://leetcode.com/problems/increasing-triplet-subsequence/
My Solution :
class Solution:
def increasingTriplet(self, nums: List[int]) -> bool:
t1 = t2 = float('INF')
for n in nums:
if n <= t1:
t1 = n
elif n <= t2:
t2 = n
else:
return True
return False
'프로그래밍 > LeetCode' 카테고리의 다른 글
[LeetCode][Python3] 395. Longest Substring with At Least K Repeating Characters (0) | 2019.03.28 |
---|---|
[LeetCode][Python3] 73. Set Matrix Zeroes (0) | 2019.03.27 |
[LeetCode][Python3] 329. Longest Increasing Path in a Matrix (0) | 2019.03.27 |
[LeetCode][Python3] 264. Ugly Number II (0) | 2019.03.26 |
[LeetCode][Python3] 297. Serialize and Deserialize Binary Tree (0) | 2019.03.25 |
[LeetCode][Python3] 105. Construct Binary Tree from Preorder and Inorder Traversal (0) | 2019.03.24 |
[LeetCode][Python3] 131. Palindrome Partitioning (0) | 2019.03.23 |
[LeetCode][Python3] 128. Longest Consecutive Sequence (0) | 2019.03.23 |
최근에 달린 댓글 최근에 달린 댓글