Skip to content

Commit

Permalink
Time: 1 ms (93.94%), Space: 42.4 MB (91.92%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Suvraneel committed Feb 3, 2025
1 parent 3cab152 commit 64dafb0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Solution {
public int longestMonotonicSubarray(int[] nums) {
int n = nums.length;
int maxMonotonicLen = 0, incStreak = 1, decStreak = 1;
int maxMonotonicLen = 1, incStreak = 1, decStreak = 1;
for (int i = 1; i < n; i++) {
if (nums[i] > nums[i - 1]) {
incStreak++;
Expand Down

0 comments on commit 64dafb0

Please sign in to comment.