Given an array of integers, every element appears twice except for one. Find that single one.
//只有一个元素不一样。那么集合中所有元素异或就可以得到结果。
class Solution {public: int singleNumber(vector & nums) { int res = 0; for(int i = 0;i
本文共 297 字,大约阅读时间需要 1 分钟。
Given an array of integers, every element appears twice except for one. Find that single one.
//只有一个元素不一样。那么集合中所有元素异或就可以得到结果。
class Solution {public: int singleNumber(vector & nums) { int res = 0; for(int i = 0;i
转载于:https://www.cnblogs.com/xiuxiu55/p/6503709.html