Einfach 0 gelöst 0% Erfolgsquote

Anagram Check

Check whether two phrases use the same letters.

Two 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.

Einschränkungen

0 ≤ length of each ≤ 10,000 (ASCII)

Beispiele

Beispiel 1
Eingabe:
first = "Listen"
second = "Silent"

Erwartete Ausgabe:
expected = True
Eingabe:
std::string first = "Listen";
std::string second = "Silent";

Erwartete Ausgabe:
bool expected = true;
Eingabe:
string first = "Listen";
string second = "Silent";

Erwartete Ausgabe:
bool expected = true;

Erläuterung

Both use e, i, l, n, s, t once each.

Beispiel 2
Eingabe:
first = "apple"
second = "paddle"

Erwartete Ausgabe:
expected = False
Eingabe:
std::string first = "apple";
std::string second = "paddle";

Erwartete Ausgabe:
bool expected = false;
Eingabe:
string first = "apple";
string second = "paddle";

Erwartete Ausgabe:
bool expected = false;

Erläuterung

The letters and counts differ.

Referenzen

Diese Aufgabe wurde für CodeUtility angepasst. Beachte die oben genannten Vorgaben und Einschränkungen.

Von anderen lernen

Community-Lösungen

Noch keine veröffentlichten Lösungen. Löse die Aufgabe und teile als Erster eine Lösung.