情况考虑不周 非边界值
作者:互联网
https://leetcode-cn.com/problems/valid-anagram/
异或运算找重复值
func f(s string) int { n := len(s) var a int a = 1 for i := 0; i < n; i++ { a ^= int(rune(s[i])) } return a } func isAnagram(s string, t string) bool { return f(s)^f(t) == 0 }
标签:考虑不周,return,string,int,边界值,func,情况,cn 来源: https://www.cnblogs.com/rsapaper/p/16155994.html