class Solution {
public:
    int singleNumber(int A[], int n) {
        
        //异或
        int elem = 0;
        for(int i = 0; i < n ; i++) {
            elem = elem ^ A[i];
        }
        
        return elem;
    }
};

相关文章:

  • 2021-07-25
  • 2021-06-10
  • 2021-06-11
  • 2021-06-27
  • 2022-01-20
  • 2021-06-19
猜你喜欢
  • 2021-10-25
  • 2021-04-30
相关资源
相似解决方案