Conversation
There was a problem hiding this comment.
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.mdandsolution/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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.