Total Accepted: 58209
Total Submissions: 143425
Difficulty: Easy
Given two strings _s_ and _t_, write a function to determine if _t_ is an anagram of _s_.
For example,
_s_ = “anagram”, _t_ = “nagaram”, return true.
_s_ = “rat”, _t_ = “car”, return false.
Note:
You may assume the string contains only lowercase alphabets.
Follow up:
What if the inputs contain unicode characters? How would you adapt your solution to such case?
求两个字符串中字母出现频率是否一致,hash最快了当然
C++:
1 | class Solution { |