您的位置:首页 > 其它

Leetcode: Single Number

2013-10-16 05:57 344 查看
http://oj.leetcode.com/problems/single-number/

class Solution {
public:
int singleNumber(int A[], int n) {
// Note: The Solution object is instantiated only once and is reused by each test case.
int res=A[0];
for(int i=1;i<n;i++){
res=res^A[i];
}
return res;
}
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: