LeetCode p242 Valid Anagram 题解
1.题目:
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.
题意:
输入两个字符串判断这两个字符串的所有元素是否相同
2.解题思路:
借用了啊哈算法里面提到的桶排序
3.代码
1 |
|