Skip to content

Commit 72cad73

Browse files
author
Tushar Borole
committed
394. Decode String
1 parent 259b943 commit 72cad73

File tree

3 files changed

+41
-13
lines changed

3 files changed

+41
-13
lines changed

.idea/workspace.xml

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
|:-----|:--------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------|:-----------------|:---------------------|:-----------|:----------------|:-----------------|:-------------------------------------------------------------------------------|
1010
| 709 | [To Lower Case](https://leetcode.com/problems/to-lower-case/) | [Solution](to_lower_case.js) | 72 ms | 32.1 MB | Easy | | | |
1111
| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [two_sum.js](two_sum.js) | 52 ms | 35 MB | Easy | | | |
12+
| 674 | [Longest Continuous Increasing Subsequence](https://leetcode.com/problems/longest-continuous-increasing-subsequence/) | [Window Sliding Method](longest_continuous_increasing_subsequence.js) | | 35.1 MB | Easy | | | |
1213
| 443 | [String Compression](https://leetcode.com/problems/string-compression/) | [string_compression.js](string_compression.js) | | | Easy | | | |
1314
| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [iterative](best_time_to_buy_and_sell_stock_II.js) | 56 ms | 35.4 MB | Easy | O(N) | O(1) | |
1415
| 1122 | [Relative Sort Array](https://leetcode.com/problems/relative-sort-array/) | [Ittrative](relative_sort_array.js) | 52 ms | 34.9 MB | Easy | | | |
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var findLengthOfLCIS = function(nums) {
6+
let counter = 1;
7+
let out = 0;
8+
let i = 0;
9+
let j = 0;
10+
11+
while (j < nums.length) {
12+
if (nums[j] < nums[j + 1]) {
13+
counter++;
14+
j++;
15+
} else {
16+
i = j;
17+
j++;
18+
counter = 1;
19+
}
20+
out = Math.max(out, counter);
21+
}
22+
23+
return out;
24+
};
25+
26+
findLengthOfLCIS([]); //?

0 commit comments

Comments
 (0)