LeetCode Single Number
2014-10-13 11:34
211 查看
主要思想为相同的数异或之后为0
class Solution {
public:
int singleNumber(int A[], int n) {
int temp=A[0];
for(int i=1;i<n;i++){
temp=temp^A[i];
}
return temp;
}
};
class Solution {
public:
int singleNumber(int A[], int n) {
int temp=A[0];
for(int i=1;i<n;i++){
temp=temp^A[i];
}
return temp;
}
};
相关文章推荐
- lintcode/leetcode由易至难第14题:Single Number
- LeetCode Single Number
- LeetCode: Single Number
- leetcode: Single Number
- LeetCode 136 Single Number
- [LeetCode]Single Number
- LeetCode - Single Number
- LeetCode 136. Single Number
- leetcode || 136、Single Number
- LeetCode:Single Number
- 【leetcode】136. Single Number【java】使用异或
- leetcode136~Single Number
- [leetcode] Single Number
- LeetCode——Single Number
- LeetCode 找出 单独的数 Single Number
- 【C++】【LeetCode】136. Single Number
- [Leetcode]Single Number
- LeetCode - Single Number
- [Leetcode]Single Number
- leetcode - Single Number