Skip to content

update: 添加问题“3761.镜像对之间最小绝对距离”的代码和题解#1511

Merged
Tisfy merged 6 commits intoLetMeFly666:masterfrom
Tisfy:3761
Apr 17, 2026
Merged

update: 添加问题“3761.镜像对之间最小绝对距离”的代码和题解#1511
Tisfy merged 6 commits intoLetMeFly666:masterfrom
Tisfy:3761

Conversation

@Tisfy
Copy link
Copy Markdown
Collaborator

@Tisfy Tisfy commented Apr 17, 2026

By newSolution.py using GH on Windows | close: #1510

@Tisfy Tisfy requested a review from LetMeFly666 as a code owner April 17, 2026 15:20
@Tisfy Tisfy added the 题解 Solution label Apr 17, 2026
@Tisfy Tisfy self-assigned this Apr 17, 2026
@Tisfy Tisfy added the under merge pr准备就绪 请做merge前最后的检查 label Apr 17, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@LetMeFly666 LetMeFly666 requested a review from Copilot April 17, 2026 15:29
@LetMeFly666
Copy link
Copy Markdown
Owner

@gh-pr-review make a review

Copy link
Copy Markdown
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 the new LeetCode problem 3761. 镜像对之间最小绝对距离 to the repository (code + README index entry), and cleans up the existing 2515 solution files by consolidating the accepted logic into the main file.

Changes:

  • Add C++ solution for LeetCode 3761 and index it in README.md.
  • Fix the iteration bound in LeetCode 2515 solution and remove an extra _AC duplicate file.
  • Remove .commitmsg from the repo.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Adds the 3761 entry (problem + solution links) to the problem list table.
Codes/3761-minimum-absolute-distance-between-mirror-pairs.cpp New C++ solution implementation for LeetCode 3761.
Codes/2515-shortest-distance-to-target-string-in-a-circular-array.cpp Fixes the loop bound to correctly handle the farthest index in even-length arrays; removes a stale comment.
Codes/2515-shortest-distance-to-target-string-in-a-circular-array_AC.cpp Deletes the redundant accepted-version file after consolidation.
.commitmsg Removes the committed local commit-message helper file.

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

Comment thread Codes/3761-minimum-absolute-distance-between-mirror-pairs.cpp
Copy link
Copy Markdown
Contributor

@gh-pr-review gh-pr-review Bot left a comment

Choose a reason for hiding this comment

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

PR 概要

本 PR 添加了 LeetCode 3761「镜像对之间最小绝对距离」的 C++ 解题代码和题解文档,同时修复了 2515 题的循环边界 bug(n/2n/2+1),清理了不再需要的 _AC 后缀文件和 .commitmsg,并在 README 中添加了新题目索引。

代码正确性分析

文件 变更类型 正确性 说明
Codes/3761-...cpp 新增 ✅ 正确 哈希表解法,遍历时维护 reverse 映射,逻辑清晰
Codes/2515-...cpp 修改 ✅ 正确 修复循环边界 n/2n/2+1,避免遗漏对称位置元素
Codes/2515-..._AC.cpp 删除 ✅ 合理 修复后原 AC 文件冗余,合并到主文件
.commitmsg 删除 ✅ 合理 临时提交信息文件清理
README.md 修改 ✅ 正确 新增 3761 题目索引行
题解 Markdown 新增 ⚠️ 有小瑕疵 题解正文有措辞问题(见下方 P3)

潜在问题与建议

P3(低优先级)

  1. inf 常量值硬编码为 10000003761 文件第 11 行)

    当前 constexpr int inf = 1000000; 虽然对于本题 nums.length ≤ 10^5 足够,但若直接使用 INT_MAX 更具通用性和自解释性,也避免了未来题目约束变更导致的潜在风险。见行内 suggestion。

  2. 题解文档措辞小问题Solutions/LeetCode 3761.镜像对之间最小绝对距离.md

    原文:"由于合法的 $reverse(nums[i])==nums[j]$ 必须满足 $i\lt j$,所以直接枚举前面所以不必考虑前面一个元素和后面某元素的 reverse 相等的情况。"

    "所以"出现了两次,语义不通顺。建议改为:"由于合法的 $reverse(nums[i])==nums[j]$ 必须满足 $i\lt j$,所以只需从左到右枚举,不必考虑后面元素的 reverse 与前面元素匹配的情况。"

总结

维度 评级 说明
正确性 ⭐⭐⭐⭐⭐ 算法逻辑正确,2515 bug fix 合理
可读性 ⭐⭐⭐⭐ 代码简洁清晰,命名合理
健壮性 ⭐⭐⭐⭐ inf 硬编码为小瑕疵,不影响正确性
文档 ⭐⭐⭐⭐ 题解完整,有小措辞问题

最终合并建议

建议合并。代码正确,变更合理。上述 P3 问题均为低优先级改进建议,不阻塞合并。

Review by AI Assistant

Comment thread Codes/3761-minimum-absolute-distance-between-mirror-pairs.cpp
@Tisfy Tisfy removed the under merge pr准备就绪 请做merge前最后的检查 label Apr 17, 2026
@Tisfy Tisfy merged commit f672af1 into LetMeFly666:master Apr 17, 2026
5 checks passed
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 3761

3 participants