Skip to content

feat: update solutions for lc No.0022#5132

Merged
yanglbme merged 1 commit intomainfrom
dev
Apr 4, 2026
Merged

feat: update solutions for lc No.0022#5132
yanglbme merged 1 commit intomainfrom
dev

Conversation

@yanglbme
Copy link
Copy Markdown
Member

@yanglbme yanglbme commented Apr 4, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 00:16
@idoocs idoocs added core team Issues or pull requests from core team cpp Issues or Pull requests relate to .cpp code js Issues or Pull requests relate to .js code md Issues or Pull requests relate to .md files php Issues or Pull requests relate to .php code py Issues or Pull requests relate to .py code ts Issues or Pull requests relate to .ts code labels Apr 4, 2026
@yanglbme yanglbme merged commit 3367aa8 into main Apr 4, 2026
15 of 16 checks passed
@yanglbme yanglbme deleted the dev branch April 4, 2026 00:17
Copy link
Copy Markdown

Copilot AI left a comment

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 LeetCode #22 “Generate Parentheses” solutions to standardize on a DFS + pruning approach across languages, modernize syntax/types, and remove the previously documented alternate JS/TS “insert () + dedupe” solution.

Changes:

  • Refactor TS/JS implementations to use const + arrow-function DFS and stronger typing in TS.
  • Update Python/PHP/C++ implementations (and corresponding README snippets) with improved typing/structure and a modern recursive-lambda pattern in C++.
  • Remove Solution2.{ts,js} and the associated “Solution 2” section from both READMEs.

Reviewed changes

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

Show a summary per file
File Description
solution/0000-0099/0022.Generate Parentheses/Solution2.ts Removed redundant alternate TS solution.
solution/0000-0099/0022.Generate Parentheses/Solution2.js Removed redundant alternate JS solution.
solution/0000-0099/0022.Generate Parentheses/Solution.ts Modernize DFS definition and add explicit string[] typing for ans.
solution/0000-0099/0022.Generate Parentheses/Solution.js Modernize DFS definition and use const for ans.
solution/0000-0099/0022.Generate Parentheses/Solution.py Add type annotations for DFS helper and normalize string quoting.
solution/0000-0099/0022.Generate Parentheses/Solution.php Refactor closure-based recursion to class-method recursion with stored state.
solution/0000-0099/0022.Generate Parentheses/Solution.cpp Switch to a modern recursive lambda pattern and expand guard formatting.
solution/0000-0099/0022.Generate Parentheses/README.md Sync code snippets with updated implementations; remove “方法二”.
solution/0000-0099/0022.Generate Parentheses/README_EN.md Sync code snippets with updated implementations; remove “Solution 2”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core team Issues or pull requests from core team cpp Issues or Pull requests relate to .cpp code js Issues or Pull requests relate to .js code md Issues or Pull requests relate to .md files php Issues or Pull requests relate to .php code py Issues or Pull requests relate to .py code ts Issues or Pull requests relate to .ts code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants