問題
翻訳を表示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.
制約
0 ≤ length of each ≤ 10,000 (ASCII)
例
例 1
入力:
first = "Listen"
second = "Silent"
期待される出力:
expected = True
入力:
std::string first = "Listen";
std::string second = "Silent";
期待される出力:
bool expected = true;
入力:
string first = "Listen";
string second = "Silent";
期待される出力:
bool expected = true;
解説
Both use e, i, l, n, s, t once each.
例 2
入力:
first = "apple"
second = "paddle"
期待される出力:
expected = False
入力:
std::string first = "apple";
std::string second = "paddle";
期待される出力:
bool expected = false;
入力:
string first = "apple";
string second = "paddle";
期待される出力:
bool expected = false;
解説
The letters and counts differ.
参考資料
この課題はCodeUtility用に調整されています。上記の説明と制約に従ってください。