Skip to content

feat: update solutions to lc problem: No.2958 - #5348

Merged
yanglbme merged 1 commit into
mainfrom
feat/lc-2958
Aug 12, 2026
Merged

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

Conversation

@yanglbme

Copy link
Copy Markdown
Member

Summary

  • Update solutions for No.2958 Length of Longest Subarray With at Most K Frequency: rewrite implementations (Python/Java/C++/Go/TypeScript) with cleaner two-pointer naming (l/r) and add a new Rust solution
  • Sync README.md and README_EN.md code blocks, add Rust tab, and update the Chinese/English solution descriptions to match the new implementations

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 12, 2026 00:53
@cursor

cursor Bot commented Aug 12, 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 51e41d4 into main Aug 12, 2026
8 checks passed
@yanglbme
yanglbme deleted the feat/lc-2958 branch August 12, 2026 00:55

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 solution set for LeetCode #2958 (“Length of Longest Subarray With at Most K Frequency”) by standardizing the sliding-window/two-pointer implementations (using l/r naming) and adding a new Rust solution, while keeping the Chinese/English READMEs in sync with the updated code.

Changes:

  • Rewrote existing Python/Java/C++/Go/TypeScript solutions with consistent l/r two-pointer naming.
  • Added a new Rust implementation (Solution.rs) using the same sliding-window approach.
  • Updated README.md and README_EN.md to sync code blocks/descriptions and add a Rust tab.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/Solution.ts Refactors TypeScript sliding-window variables to l/r and uses while for shrink logic.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/Solution.rs Adds Rust sliding-window solution using HashMap frequency counts.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/Solution.py Refactors Python two-pointer implementation to l/r naming.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/Solution.java Refactors Java two-pointer implementation to l/r naming.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/Solution.go Refactors Go two-pointer implementation to l/r naming and minor map init cleanup.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/Solution.cpp Refactors C++ two-pointer implementation to l/r naming.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/README.md Updates CN explanation/code blocks to match refactors; adds Rust snippet/tab.
solution/2900-2999/2958.Length of Longest Subarray With at Most K Frequency/README_EN.md Updates EN explanation/code blocks to match refactors; adds Rust snippet/tab.

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

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