Anonymizer Substitution Audit accepts distinct-count-only solutions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Anonymizer Substitution Audit (LeetCode 205) の組み込みテストケースを見つけ、C++ runner にどのように渡されているかを調べてください。["aab", "abb"] を期待値 false で追加し、既存のケースが引き続きすべて通ることと、異なる文字数だけを数える解法がこのケースで失敗することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Observed behavior
Anonymizer Substitution Audit (isomorphic-strings, LeetCode 205) accepts a solution that only compares the number of distinct characters in the two strings:
#include <string>
#include <unordered_set>
using namespace std;
class Solution {
public:
bool isConsistentCipher(string s, string t) {
unordered_set<char> a(s.begin(), s.end());
unordered_set<char> b(t.begin(), t.end());
return a.size() == b.size();
}
};
This solution passes all seven built-in cases. However, equal distinct-character counts do not establish a consistent one-to-one substitution.
For example:
s = "aab"
t = "abb"
Expected: false
Actual: true
The first occurrence of a would map to a, while the second would map to b, violating the problem's substitution rule.
All current false cases have different distinct-character counts, so they do not distinguish this shortcut from a correct implementation.
Expected behavior
The built-in cases should reject this solution by including a valid input with equal distinct-character counts but inconsistent character mappings, such as ["aab", "abb"], expecting false.
A correct two-way mapping solution should continue to pass every case.
Reproduction
- Open Anonymizer Substitution Audit and select C++.
- Replace the starter code with the solution above.
- Run the tests. All seven built-in cases pass.
CodeTrial version
codetrial 0.1.0 (9817ef6)
Environment
OS: Windows, x64
Browser: Microsoft Edge 157.0.4341.42 (headless verification)
Language: C++
Interview loop: N/A — direct browser-runner verification
Problem: Anonymizer Substitution Audit (LeetCode 205)
REACTO or STAR step: N/A
Reconnect: N/A
Sanitized evidence
Verified using the actual runBrowserTests implementation with language: "cpp" at the revision above:
| Implementation | Built-in cases | Result for ["aab", "abb"] |
|---|---|---|
| Distinct-count-only C++ solution | 7/7 | true — incorrect |
| Correct two-way mapping C++ solution | 7/7 | false — correct |
A separate counterexample check produced:
Input: ["aab", "abb"]
Expected: false
Got: true
The correct control uses mappings in both directions to enforce consistency and uniqueness.
Public data confirmation
- I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
- 主要言語
- Rust
- スター
- 236
- フォーク
- 153
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 187
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
Unify Java harness validation error messages対応中かも @weichieh0204 が今日担当しました。 オープン
sysprog21/codetrial#872 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Inferred void class operations are never checked against the starter's return type対応中かも @papaya0112 が今日担当しました。 オープン
sysprog21/codetrial#871 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Edge Thumbnail Store accepts a store that does not refresh a key on overwrite対応中かも @BOBOGUAGUA428 が今日担当しました。 オープン
sysprog21/codetrial#869 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Highway Billboard Leasing accepts a solution that greedily leases the largest offer first対応中かも @PeteChiang1211 が今日担当しました。 オープン
sysprog21/codetrial#868 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
bug bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
storytold/photocraft#17140 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
-
bug command Java Edition protocol
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Pumpkin-MC/Pumpkin#4733 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
area:parity status:ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
neilsh/stunt-reel#1133 ·
メンテナーはふだん 1 日以内に返信