Copy-with-random tests accept a copied list that loops back into itself
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Observed behavior
In Outline Snapshot Duplicator question,a deep copy whose last node links back to the first copy passes 5/5 in C++, same as a correct solution.
Expected behavior
A returned copy that reaches a node twice fails with the message the plain list serializers now use, "Returned list must not reach a node twice."A correct copy still passes 5/5, and "empty random list" is unaffected.
Reproduction
- Open Outline Snapshot Duplicator and select C++.
- Paste the solution below and run tests. All 5 cases pass.
- Change
copies[head]on the marked line tonullptr(the correct solution) and run tests again. All 5 cases pass.
class Solution {
public:
Node* snapshotOutline(Node* head) {
if (!head) return nullptr;
unordered_map<Node*, Node*> copies;
for (Node* p = head; p; p = p->next) copies[p] = new Node(p->val);
for (Node* p = head; p; p = p->next) {
copies[p]->next = p->next ? copies[p->next] : copies[head]; // should be nullptr
copies[p]->random = p->random ? copies[p->random] : nullptr;
}
return copies[head];
}
};
CodeTrial version
My Windows binary (codetrial-x86_64-pc-windows-msvc.exe) does not accept --version: it answers "--version requires a value". File times: created 2026-09-17 10:05 and last modified 2026-10-15 12:53 (UTC+8). The same serializer code is still on main at 6756678.
Environment
OS: Windows 11
Browser: Chrome
Language: C++
Interview loop: Coding
Problem: Outline Snapshot Duplicator
REACTO or STAR step: Test
Reconnect: None
Sanitized evidence
No response
Public data confirmation
- I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
- Ngôn ngữ chính
- Rust
- Star
- 177
- Fork
- 100
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 182
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sysprog21/codetrial
-
Selecting a pen color leaves Example drawing in eraser modeCó thể đã có người làm @Aa99841 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sysprog21/codetrial#437 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python tests lose every result when the solution returns inf or NaNCó thể đã có người làm @shensyuan đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
sysprog21/codetrial#419 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Allow deselecting a chosen problem card by clicking it againCó thể đã có người làm @woohsin đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sysprog21/codetrial#392 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Audio output can be confirmed without playing a test soundCó thể đã có người làm @ChenYingHan1121 đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
sysprog21/codetrial#359 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a Copy code button to the final reportCó thể đã có người làm @yansawu đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
sysprog21/codetrial#318 · 6 bình luận · 2 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sysprog21/codetrial
Issue tương tự
-
Docker host resolution missing default rootless Docker pathCó thể đã có người làm @500B đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
testcontainers/testcontainers-rs#1000 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug needs triage P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pbakaus/impeccable#1143 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bundled uv is never updated and trusts the compromised eMudhra certificatesCó thể đã có người làm @FabienDanieau đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày