mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
11 lines
168 B
Go
11 lines
168 B
Go
package leetcode
|
|
|
|
func findTheDifference(s string, t string) byte {
|
|
n, ch := len(t), t[len(t)-1]
|
|
for i := 0; i < n-1; i++ {
|
|
ch ^= s[i]
|
|
ch ^= t[i]
|
|
}
|
|
return ch
|
|
}
|