Dễ 0 đã giải Tỷ lệ chấp nhận 0%

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.

Ràng buộc

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

Ví dụ

Ví dụ 1
Đầu vào:
first = "Listen"
second = "Silent"

Kết quả mong đợi:
expected = True
Đầu vào:
std::string first = "Listen";
std::string second = "Silent";

Kết quả mong đợi:
bool expected = true;
Đầu vào:
string first = "Listen";
string second = "Silent";

Kết quả mong đợi:
bool expected = true;

Giải thích

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

Ví dụ 2
Đầu vào:
first = "apple"
second = "paddle"

Kết quả mong đợi:
expected = False
Đầu vào:
std::string first = "apple";
std::string second = "paddle";

Kết quả mong đợi:
bool expected = false;
Đầu vào:
string first = "apple";
string second = "paddle";

Kết quả mong đợi:
bool expected = false;

Giải thích

The letters and counts differ.

Tham khảo

Thử thách này đã được điều chỉnh cho CodeUtility. Hãy làm theo đề bài và các ràng buộc ở trên.

Học hỏi từ người khác

Giải pháp cộng đồng

Chưa có giải pháp nào được chia sẻ. Hãy giải thử thách này để đăng giải pháp đầu tiên.