只出现一次的数字 2022-03-19 约 50 字 预计阅读 1 分钟 文章目录 题解 异或具有一下性质: n ^ 0 = n n ^ n = 0 题解 1 2 3 4 5 6 7 func singleNumber(nums []int) int { res := 0 for _, num := range nums { res ^= num } return res } 文章作者 -_- 上次更新 2022-03-19