写出一个函数 anagram(s, t)
判断两个字符串是否可以通过改变字母的顺序变成一样的字符串。
样例 1:
输入: s = "ab", t = "ab"
输出: true
样例 2:
输入: s = "abcd", t = "dcba"
输出: true
样例 3:
输入: s = "ac", t = "ab"
输出: false
O(n) 的时间复杂度, O(1) 的额外空间
什么是 Anagram?
原文:https://www.cnblogs.com/yunxintryyoubest/p/12355388.html