# #136 Single Number

a ^ 0 = a
a ^ a = 0

class Solution {
public:
int singleNumber(vector<int>& nums) {
vector<int>::iterator it;
int tmp = 0;
for (it=nums.begin();it!=nums.end();it++) {
tmp ^= *it;
}
return tmp;
}
};

• 本文已收录于以下专栏：

## 136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note: ...

## [LeetCode]--136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note: ...

## 【leetcode】136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.以后先自己想一...

## leetcode 136. Single Number

/* leetcode 136. Single Number Given an array of integers, every element appears twice except for on...

## LeetCode(136)Single Number

LeetCode刷题刷到现在，经常感到挫败。因为有些题目一想就是一整天，提交上去一看还超时了。太伤心了。现在采取更加科学合理的方式，按照AC率降序来刷题。不再采取以前的按照日期来刷的方式了。 题目如下...

## Leetcode No. 136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note: ...

举报原因： 您举报文章：深度学习：神经网络中的前向传播和反向传播算法推导 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)