one liner C++ solution


  • 0
    G
    class Solution {
    public:
        int singleNumber(vector<int>& nums) {
            
            return accumulate(nums.begin(),nums.end(),0,[](int i, int j){return i ^ j;});
            
        }
    };
    

Log in to reply
 

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