/*异或的简单应用 a^a = 0*/class Solution {public: int singleNumber(int A[], int n) { int sum = 0; for(int i = 0 ; i < n ; i++){ sum = sum^A[i]; } return sum; }};
本文共 251 字,大约阅读时间需要 1 分钟。
/*异或的简单应用 a^a = 0*/class Solution {public: int singleNumber(int A[], int n) { int sum = 0; for(int i = 0 ; i < n ; i++){ sum = sum^A[i]; } return sum; }};
转载于:https://www.cnblogs.com/llei1573/p/4374784.html