leetcode:136. 只出现一次的数字(位运算-异或)

题目:

在这里插入图片描述

分析:

异或,01为真
a⊕b = (¬a ∧ b) ∨ (a ∧¬b)
在这里插入图片描述

异或符号 ^

python的reduce:

在这里插入图片描述

代码:

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42721412/article/details/106125893