class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int res =0;

        for(auto it : nums){
            res^=it;
        }

        return res;
    }
};

https://leetcode.com/problems/single-number/

https://takeuforward.org/arrays/find-the-number-that-appears-once-and-the-other-numbers-twice/