时间复杂度:(O(n))
class Solution { public: int singleNumber(vector<int>& nums) { int ans = 0; for (auto x: nums) ans ^= x; return ans; } };