Anonymizer Substitution Audit accepts distinct-count-only solutions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Encuentra los casos integrados de Anonymizer Substitution Audit (LeetCode 205) e inspecciona cómo se pasan al ejecutor de C++. Añade ["aab", "abb"] con el resultado esperado false y, después, confirma que los casos existentes siguen pasando y que la solución que solo cuenta los caracteres distintos falla con este caso.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 236
- Forks
- 153
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 187
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sysprog21/codetrial
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Unify Java harness validation error messagesPosiblemente ocupada @weichieh0204 la tomó hoy. Abierto
sysprog21/codetrial#872 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Inferred void class operations are never checked against the starter's return typePosiblemente ocupada @papaya0112 la tomó hoy. Abierto
sysprog21/codetrial#871 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Edge Thumbnail Store accepts a store that does not refresh a key on overwritePosiblemente ocupada @BOBOGUAGUA428 la tomó hoy. Abierto
sysprog21/codetrial#869 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Highway Billboard Leasing accepts a solution that greedily leases the largest offer firstPosiblemente ocupada @PeteChiang1211 la tomó hoy. Abierto
sysprog21/codetrial#868 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de sysprog21/codetrial
Issues similares
-
bug bugfix
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
storytold/photocraft#17140 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
-
bug command Java Edition protocol
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Pumpkin-MC/Pumpkin#4733 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
area:parity status:ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
neilsh/stunt-reel#1133 ·
Los mantenedores suelen responder en 1 día