Anonymizer Substitution Audit accepts distinct-count-only solutions
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Tìm các trường hợp tích hợp sẵn cho Anonymizer Substitution Audit (LeetCode 205) và kiểm tra cách chúng được truyền cho C++ runner. Thêm ["aab", "abb"] với kết quả mong đợi là false, sau đó xác nhận các trường hợp hiện có vẫn chạy thành công và lời giải chỉ đếm số ký tự khác nhau thất bại với trường hợp này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 236
- Fork
- 153
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 187
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Unify Java harness validation error messagesCó thể đã có người làm @weichieh0204 đã nhận hôm nay. Đang mở
sysprog21/codetrial#872 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Inferred void class operations are never checked against the starter's return typeCó thể đã có người làm @papaya0112 đã nhận hôm nay. Đang mở
sysprog21/codetrial#871 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Edge Thumbnail Store accepts a store that does not refresh a key on overwriteCó thể đã có người làm @BOBOGUAGUA428 đã nhận hôm nay. Đang mở
sysprog21/codetrial#869 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Highway Billboard Leasing accepts a solution that greedily leases the largest offer firstCó thể đã có người làm @PeteChiang1211 đã nhận hôm nay. Đang mở
sysprog21/codetrial#868 · 1 bình luận · 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ự
-
bug bugfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
storytold/photocraft#17140 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
-
bug command Java Edition protocol
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Pumpkin-MC/Pumpkin#4733 ·
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 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
area:parity status:ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
neilsh/stunt-reel#1133 ·
Maintainer thường phản hồi trong vòng 1 ngày