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 4facff3 commit 145132cCopy full SHA for 145132c
3001-3500/3349.js
@@ -0,0 +1,13 @@
1
+var hasIncreasingSubarrays = function(nums, k) {
2
+ let inc = 1, prevInc = 0, maxLen = 0;
3
+ for (let i = 1; i < nums.length; i++) {
4
+ if (nums[i] > nums[i - 1]) inc++;
5
+ else {
6
+ prevInc = inc;
7
+ inc = 1;
8
+ }
9
+ maxLen = Math.max(maxLen, Math.max(inc >> 1, Math.min(prevInc, inc)));
10
+ if (maxLen >= k) return true;
11
12
+ return false;
13
+};
0 commit comments