Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add solutions to lc problem: No.3026 #2313

Merged
merged 14 commits into from
Feb 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style: format code and docs with prettier
  • Loading branch information
Nothing-avil authored and idoocs committed Feb 4, 2024
commit 3433e7c13c4c42be29a41275d7d268557c0e36fb
5 changes: 2 additions & 3 deletions solution/3000-3099/3026.Maximum Good Subarray Sum/Solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ function maximumSubarraySum(nums: number[], k: number): number {
if (t !== undefined) {
r = Math.max(r, s - t);
}
if (i + 1 === n)
break;
if (i + 1 === n) break;
t = p.get(nums[i + 1]);
if (t === undefined || t > s) {
p.set(nums[i + 1], s);
}
}
return r === Number.MIN_SAFE_INTEGER ? 0 : r;
};
}