![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Bit Manipulation
文章平均质量分 60
Ellie_
这个作者很懒,什么都没留下…
展开
-
[LeetCode]268. Missing Number
Point: a^b^b=a.two xor operations with the same number will eliminate the number and reveal the original number. 两个相同的数异或结果为0。一个数和两个相同的数异或的结果为它自身。 Given an array containing n distinct numbers原创 2017-08-03 14:33:00 · 219 阅读 · 0 评论 -
[LeetCode]389. Find the Difference
依旧是利用a^b^b==a的bit manipulation的特性。另一个方法则利用了将字母作为数组下标的方法。(从本质上来讲,在计算机里面,可以认为char就是int了,就是说可以把char当作int来用,如,作为数组下标。) Given two strings s and t which consist of only lowercase letters. String原创 2017-08-06 21:13:05 · 216 阅读 · 0 评论