โจทย์
ดูฉบับแปล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 กรุณาทำตามคำชี้แจงและข้อจำกัดด้านบน