Golang | Leetcode Golang题解之第389题找不同
题目:
题解:
func findTheDifference(s, t string) (diff byte) {
for i := range s {
diff ^= s[i] ^ t[i]
}
return diff ^ t[len(t)-1]
}
题目:
题解:
func findTheDifference(s, t string) (diff byte) {
for i := range s {
diff ^= s[i] ^ t[i]
}
return diff ^ t[len(t)-1]
}