Skip to content

Commit d7bf4e5

Browse files
committed
Day69
1 parent 99bd944 commit d7bf4e5

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

Day69/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {boolean}
4+
*/
5+
var increasingTriplet = function (nums) {
6+
7+
let first = Infinity;
8+
let second = Infinity;
9+
for (let n of nums) {
10+
if (n <= first) {
11+
first = n
12+
} else if (n <= second) {
13+
second = n
14+
} else {
15+
return true
16+
}
17+
18+
}
19+
20+
21+
return false
22+
23+
};

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to
153153

154154
|Day 67| [98. Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [javascript]()|[:memo:](https://leetcode.com/problems/validate-binary-search-tree/)|Medium|
155155

156-
|Day 68| [454. 4Sum II](https://leetcode.com/problems/4sum-ii/) | [javascript]()|[:memo:](https://leetcode.com/problems/4sum-ii/)|Medium|
156+
|Day 68| [454. 4Sum II](https://leetcode.com/problems/4sum-ii/) | [javascript]()|[:memo:](https://leetcode.com/problems/4sum-ii/)|Medium|
157+
158+
159+
|Day 69| [334. Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [javascript]()|[:memo:](https://leetcode.com/problems/increasing-triplet-subsequence/)|Medium|

0 commit comments

Comments
 (0)