a^b^a = (a^a)^b = b
class Solution { public: int singleNumber(vector<int>& nums) { int ans = 0; for(auto &item : nums) { ans ^= item; } return ans; } };
leetcode 只出现一次的数字 简单
原文:https://www.cnblogs.com/rookie-acmer/p/15054010.html