Conversation
There was a problem hiding this comment.
Pull request overview
Adds multi-language reference solutions and documentation for LeetCode 3890: Integers With Multiple Sum of Two Cubes.
Changes:
- Implemented preprocessing (enumerate (1 \le a \le b \le 1000)) + binary search query across C++, Java, Go, Python, and TypeScript.
- Added/expanded CN + EN explanations and code snippets in the problem README files.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/Solution.ts | TypeScript solution using precomputed “good” integers and binary search. |
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/Solution.py | Python solution with module-level preprocessing and bisect query. |
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/Solution.java | Java solution using static init preprocessing and binary search. |
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/Solution.go | Go solution using init() preprocessing and sort.Search. |
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/Solution.cpp | C++ solution using global init lambda preprocessing and upper_bound. |
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/README.md | CN editorial: preprocessing + binary search, with multi-language snippets. |
| solution/3800-3899/3890.Integers With Multiple Sum of Two Cubes/README_EN.md | EN editorial: preprocessing + binary search, with multi-language snippets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| })(); | ||
|
|
||
| function findGoodIntegers(n: number): number[] { | ||
| const idx = _.sortedLastIndex(GOOD, n); |
There was a problem hiding this comment.
For consistency with other TypeScript solutions in this repo (which generally use _.sortedIndex(arr, x + 1) for an upper bound), consider replacing _.sortedLastIndex(GOOD, n) with _.sortedIndex(GOOD, n + 1) in the TypeScript snippet.
| const idx = _.sortedLastIndex(GOOD, n); | |
| const idx = _.sortedIndex(GOOD, n + 1); |
| })(); | ||
|
|
||
| function findGoodIntegers(n: number): number[] { | ||
| const idx = _.sortedLastIndex(GOOD, n); |
There was a problem hiding this comment.
For consistency with other TypeScript solutions in this repo (which generally use _.sortedIndex(arr, x + 1) for an upper bound), consider replacing _.sortedLastIndex(GOOD, n) with _.sortedIndex(GOOD, n + 1) in the TypeScript snippet.
| const idx = _.sortedLastIndex(GOOD, n); | |
| const idx = _.sortedIndex(GOOD, n + 1); |
| })(); | ||
|
|
||
| function findGoodIntegers(n: number): number[] { | ||
| const idx = _.sortedLastIndex(GOOD, n); |
There was a problem hiding this comment.
Most TypeScript solutions in this repo use _.sortedIndex(arr, x + 1) to implement an upper-bound (e.g., solution/3700-3799/3770.../Solution.ts). Consider switching from _.sortedLastIndex(GOOD, n) to _.sortedIndex(GOOD, n + 1) for consistency with the existing pattern.
| const idx = _.sortedLastIndex(GOOD, n); | |
| const idx = _.sortedIndex(GOOD, n + 1); |
No description provided.