Posted on

Description

Submission

class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int res = 0;
        for(int num : nums) {
            res ^= num;
        }
        return res;
    }
};

Leave a Reply

Your email address will not be published. Required fields are marked *