We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f57e00 commit e8f521cCopy full SHA for e8f521c
longest-increasing-subsequence/wogha95.js
@@ -11,6 +11,7 @@
11
var lengthOfLIS = function (nums) {
12
// 각자 스스로는 최소 1의 lengthOfLIS를 가짐
13
const longestLength = new Array(nums.length).fill(1);
14
+ let result = 1;
15
16
// nums배열의 right까지 원소들 중 lengthOfLIS를 저장
17
for (let right = 1; right < nums.length; right++) {
@@ -20,9 +21,10 @@ var lengthOfLIS = function (nums) {
20
21
longestLength[right],
22
longestLength[left] + 1
23
);
24
+ result = Math.max(result, longestLength[right]);
25
}
26
27
28
- return Math.max(...longestLength);
29
+ return result;
30
};
0 commit comments