Problema
Ver traducciónTwo phrases are anagrams if they contain exactly the same letters the same number of times, ignoring case, spaces and punctuation.
Implement is_anagram(first, second).
Input
first: The first phrase. second: The second phrase.
Output
Return true if the phrases are anagrams.
Restricciones
0 ≤ length of each ≤ 10,000 (ASCII)
Ejemplos
Ejemplo 1
Entrada:
first = "Listen"
second = "Silent"
Salida esperada:
expected = True
Entrada:
std::string first = "Listen";
std::string second = "Silent";
Salida esperada:
bool expected = true;
Entrada:
string first = "Listen";
string second = "Silent";
Salida esperada:
bool expected = true;
Explicación
Both use e, i, l, n, s, t once each.
Ejemplo 2
Entrada:
first = "apple"
second = "paddle"
Salida esperada:
expected = False
Entrada:
std::string first = "apple";
std::string second = "paddle";
Salida esperada:
bool expected = false;
Entrada:
string first = "apple";
string second = "paddle";
Salida esperada:
bool expected = false;
Explicación
The letters and counts differ.
Referencias
Este reto está adaptado para CodeUtility. Sigue el enunciado y las restricciones indicadas arriba.