Given two strings s and t , write a function to determine if t is an anagram of s.
Example 1:
1 | Input: s = "anagram", t = "nagaram" |
Example 2:
1 | Input: s = "rat", t = "car" |
Note:
You may assume the string contains only lowercase alphabets.
anagram意思是數字字元都相同,我想排序後檢查是否一樣最直覺了
1 | T:O(nlogn), S:O(n) |
如果你覺得這篇文章很棒,請你不吝點讚 (゚∀゚)