题目:https://leetcode.com/problems/single-number/
代码(github):https://github.com/illuz/leetcode
一个整数数组中只有一个数出现了一次,其它都出现了两次,要你找出这个数。
很经典的面试题,二进制异或的经典应用。
了解了异或的性质后就知道为什么所有数异或一遍这个数就能出来。
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
题目:https://leetcode.com/problems/single-number/
代码(github):https://github.com/illuz/leetcode
一个整数数组中只有一个数出现了一次,其它都出现了两次,要你找出这个数。
很经典的面试题,二进制异或的经典应用。
了解了异或的性质后就知道为什么所有数异或一遍这个数就能出来。