C++ 3 lines


  • 0
        int singleNumber(vector<int>& nums) {
            int ans = 0;
            for(intint n: nums) ans ^= n;
            return ans;
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.