Skip to content

Conversation

@LetMeFly666
Copy link
Owner

By newSolution.py using GH on MacOS | close: #1310

1458: AC.cpp (#1310) + word(en) + fix(pic)

cpp - AC,84.23%,29.53%
py - AC,97.99%,39.85%
go - AC,76.92%,38.46%
java - AC,65.24%,32.38%
rust - AC,100.00%,60.00%

Signed-off-by: LetMeFly666 <814114971@qq.com>
Copilot AI review requested due to automatic review settings January 8, 2026 02:13
@LetMeFly666 LetMeFly666 added the 题解 Solution label Jan 8, 2026
@LetMeFly666 LetMeFly666 self-assigned this Jan 8, 2026
@LetMeFly666 LetMeFly666 added the under merge pr准备就绪 请做merge前最后的检查 label Jan 8, 2026
Copy link
Owner Author

@LetMeFly666 LetMeFly666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
昨晚忘记测试api-hook-listener了

@LetMeFly666
Copy link
Owner Author

waiting for copilot and test for hook

Copy link
Contributor

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 adds a solution for LeetCode problem 1458 "两个子序列的最大点积" (Max Dot Product of Two Subsequences) in five programming languages (C++, Python, Java, Go, and Rust). The solution uses dynamic programming to find the maximum dot product between two subsequences.

Key changes:

  • Implemented the max dot product solution in C++, Python, Java, Go, and Rust
  • Updated README.md with the new problem entry and links to solutions
  • Added three new English vocabulary words to the learning notes

Reviewed changes

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

Show a summary per file
File Description
toSay.md Removed outdated announcement about Cloudflare proxy changes
Solutions/Other-English-LearningNotes-SomeWords.md Added three new English vocabulary words (defy, pasture, tread)
README.md Added entry for problem 1458 with links to solutions on multiple platforms
Codes/lib.rs Updated include statement to reference the new Rust solution file
Codes/1458-max-dot-product-of-two-subsequences.rs New Rust implementation using DP with O(n*m) time complexity
Codes/1458-max-dot-product-of-two-subsequences.py New Python implementation using DP with enumerate
Codes/1458-max-dot-product-of-two-subsequences.java New Java implementation using DP with Arrays.fill for initialization
Codes/1458-max-dot-product-of-two-subsequences.go New Go implementation with custom max helper functions
Codes/1458-max-dot-product-of-two-subsequences.cpp New C++ implementation using space-optimized DP approach
.commitmsg Commit message with performance metrics for all language implementations

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

}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
dp[i][j] = Math.max(nums1[i-1] * nums2[j-1], Math.max(dp[i-1][j], Math.max(dp[i][j - 1], dp[i-1][j-1] + nums1[i-1] * nums2[j-1])));
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent spacing around the subtraction operator. The expression uses dp[i][j - 1] with spaces but nums1[i-1] and nums2[j-1] without spaces. For better consistency and readability, consider using uniform spacing: either spaces around all minus operators or no spaces for all.

Suggested change
dp[i][j] = Math.max(nums1[i-1] * nums2[j-1], Math.max(dp[i-1][j], Math.max(dp[i][j - 1], dp[i-1][j-1] + nums1[i-1] * nums2[j-1])));
dp[i][j] = Math.max(nums1[i - 1] * nums2[j - 1], Math.max(dp[i - 1][j], Math.max(dp[i][j - 1], dp[i - 1][j - 1] + nums1[i - 1] * nums2[j - 1])));

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦吼

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不如把dp[i][j - 1]换成·、dp[i][j-1]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent spacing around the subtraction operator. The expression uses dp[i][j - 1] with spaces but nums1[i-1] and nums2[j-1] without spaces. For better consistency and readability, consider using uniform spacing: either spaces around all minus operators or no spaces for all.减法算符周围的间距不一致。表达式使用 dp[i][j - 1],带有空格,但 nums1[i-1] 和 nums2[j-1],不含空格。为了提高一致性和可读性,建议使用均匀间距:要么在所有负算符周围空格,要么全都不加空格。

@copilot 把这次java的dp[i][j - 1]换成dp[i][j-1],pr中不要包含有多余文件

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@LetMeFly666 I've opened a new pull request, #1312, to work on those changes. Once the pull request is ready, I'll request review from you.

@LetMeFly666
Copy link
Owner Author

@LetMeFly666 I've opened a new pull request, #1312, to work on those changes. Once the pull request is ready, I'll request review from you.

bye! 先合了哈哈

下次merge到新火车上

@LetMeFly666 LetMeFly666 removed the under merge pr准备就绪 请做merge前最后的检查 label Jan 8, 2026
@LetMeFly666 LetMeFly666 merged commit 420c93d into master Jan 8, 2026
8 of 9 checks passed
@LetMeFly666 LetMeFly666 deleted the 1458 branch January 8, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

题解 Solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[newSolution]Who can add 1 more problem of LeetCode 1458

2 participants