Anonymizer Substitution Audit accepts distinct-count-only solutions
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
找到 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 小时
- 30 天内合并 PR
- 187
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复