Skip to content

feat: update solutions to lc problem: No.2996 - #5347

Merged
yanglbme merged 1 commit into
mainfrom
feat/lc-2996
Aug 11, 2026
Merged

feat: update solutions to lc problem: No.2996#5347
yanglbme merged 1 commit into
mainfrom
feat/lc-2996

Conversation

@yanglbme

Copy link
Copy Markdown
Member

Summary

  • Update solutions for No.2996 Smallest Missing Integer Greater Than Sequential Prefix Sum: rewrite implementations (Python/Java/C++/Go/TypeScript) to use a bounded lookup array and add a new Rust solution
  • Sync README.md and README_EN.md code blocks, add Rust tab, and refine the solution description (complexity updated to O(n + M) time / O(M) space with M = 51)

Test plan

  • Format all sources (black / clang-format / gofmt / prettier / rustfmt)
  • lint-staged pre-commit hooks pass
  • CI checks pass

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings August 11, 2026 00:31
@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@yanglbme
yanglbme merged commit d43e743 into main Aug 11, 2026
8 checks passed
@yanglbme
yanglbme deleted the feat/lc-2996 branch August 11, 2026 00:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the multi-language solutions and documentation for LeetCode #2996 (“Smallest Missing Integer Greater Than Sequential Prefix Sum”), aiming to leverage the constraint nums[i] <= 50 for a bounded lookup approach and to add a Rust implementation.

Changes:

  • Reworked Java/C++/Go/TypeScript implementations to use a fixed-size presence array (M = 51) and a bounded scan from s.
  • Added a new Rust solution using the same bounded presence-array technique.
  • Updated README.md / README_EN.md to sync code blocks, add a Rust tab, and adjust complexity notes to O(n + M) / O(M).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/Solution.ts Switches TS implementation from Set to bounded boolean array (M=51).
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/Solution.rs Adds Rust solution using bounded boolean array and bounded scan.
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/Solution.py Refactors Python logic to use pairwise iteration and a membership structure for final scan.
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/Solution.java Switches Java implementation to bounded boolean array (M=51) with bounded scan.
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/Solution.go Switches Go implementation to bounded boolean slice (M=51) with bounded scan.
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/Solution.cpp Switches C++ implementation to bounded boolean array (M=51) with bounded scan.
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/README.md Syncs explanation/complexity and code tabs; adds Rust snippet.
solution/2900-2999/2996.Smallest Missing Integer Greater Than Sequential Prefix Sum/README_EN.md Syncs English explanation/complexity and code tabs; adds Rust snippet.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +8 to +11
st = set(nums)
while s in st:
s += 1
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants