Skip to content

feat: add solutions to lc problem: No.3958#5251

Merged
yanglbme merged 1 commit into
mainfrom
dev
Jun 10, 2026
Merged

feat: add solutions to lc problem: No.3958#5251
yanglbme merged 1 commit into
mainfrom
dev

Conversation

@yanglbme

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 10, 2026 07:02
@idoocs idoocs added core team Issues or pull requests from core team cpp Issues or Pull requests relate to .cpp code go Issues or Pull requests relate to .go code java Issues or Pull requests relate to .java code json Issues or Pull requests relate to .json files md Issues or Pull requests relate to .md files py Issues or Pull requests relate to .py code ts Issues or Pull requests relate to .ts code labels Jun 10, 2026
@yanglbme yanglbme merged commit f60e9d3 into main Jun 10, 2026
8 of 16 checks passed
@yanglbme yanglbme deleted the dev branch June 10, 2026 07:04

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

Adds repository entries and multi-language solution implementations for LeetCode 3958 (Minimum Cost to Split into Ones II), and includes small README formatting adjustments for problem 987 documentation.

Changes:

  • Added 3958 solution implementations in Python/Java/C++/Go/TypeScript plus problem READMEs (CN/EN).
  • Registered 3958 in the global solution indexes (solution/README.md and solution/README_EN.md).
  • Adjusted markdown formatting in 987 READMEs to improve rendering.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
solution/README.md Adds the 3958 entry to the Chinese global index.
solution/README_EN.md Adds the 3958 entry to the English global index.
solution/3900-3999/3958.Minimum Cost to Split into Ones II/Solution.ts TypeScript O(1) math solution implementation.
solution/3900-3999/3958.Minimum Cost to Split into Ones II/Solution.py Python O(1) math solution implementation.
solution/3900-3999/3958.Minimum Cost to Split into Ones II/Solution.java Java O(1) math solution implementation.
solution/3900-3999/3958.Minimum Cost to Split into Ones II/Solution.go Go O(1) math solution implementation.
solution/3900-3999/3958.Minimum Cost to Split into Ones II/Solution.cpp C++ O(1) math solution implementation.
solution/3900-3999/3958.Minimum Cost to Split into Ones II/README.md Adds the Chinese README for 3958 (needs CN/EN consistency fix).
solution/3900-3999/3958.Minimum Cost to Split into Ones II/README_EN.md Adds the English README for 3958.
solution/0900-0999/0987.Vertical Order Traversal of a Binary Tree/README.md Minor formatting cleanup in complexity section.
solution/0900-0999/0987.Vertical Order Traversal of a Binary Tree/README_EN.md Minor formatting cleanup; one bullet nesting issue introduced.

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

Comment on lines +1 to +3
func minCost(n int) int64 {
return int64(n * (n - 1) / 2)
} No newline at end of file
Comment on lines 328 to 332
- For any column index `col`, its corresponding position in `columnsValues` can be computed as:
-
$$
col - `leftmostCol`
$$
- $$
col - `leftmostCol`
$$

Comment on lines +17 to +21
<p>You are given an integer <code>n</code>.</p>

<p>In one operation, you may split an integer <code>x</code> into two positive integers <code>a</code> and <code>b</code> such that <code>a + b = x</code>.</p>

<p>The cost of this operation is <code>a * b</code>.</p>
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 go Issues or Pull requests relate to .go code java Issues or Pull requests relate to .java code json Issues or Pull requests relate to .json files md Issues or Pull requests relate to .md files 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