算法-Find that single one
Description
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
1 |
|
Solution
相异为1;找到相等的部分;为1的部分是不同的。
如:1 1 2 2 3 3 4 ,前三对异或为0,0和4异或为4。
算法-Find that single one
https://leehoward.cn/2019/10/15/算法-Find that single one/