Easy 1ms Java solution


  • 0
    M
    int singleNumber(int* nums, int numsSize) {
        int j=nums[0],k;
        for(k=1;k<numsSize-1;k++)
            j^=nums[k];
        return j;
    }

Log in to reply
 

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