Copy-with-random tests accept a copied list that loops back into itself
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Rust
- スター
- 177
- フォーク
- 100
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 168
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Python tests lose every result when the solution returns inf or NaN対応中かも @shensyuan が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
sysprog21/codetrial#419 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Allow deselecting a chosen problem card by clicking it again対応中かも @woohsin が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
sysprog21/codetrial#392 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Audio output can be confirmed without playing a test sound対応中かも @ChenYingHan1121 が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
sysprog21/codetrial#359 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add a Copy code button to the final report対応中かも @yansawu が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
sysprog21/codetrial#318 · コメント 5 件 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
area:sim good first issue kind:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
The demo's interval button and chart legend keep the previous interval after an interval changeオープンbug ui
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
userFRM/egui-charts#670 ·
メンテナーはふだん 1 日以内に返信
-
docs good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
Usenova-Labs/usenova-backend#35 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
lugassawan/swe-workbench#823 ·
メンテナーはふだん 1 日以内に返信