C++ Solution for problem 540. !Must see!


  • -1
    N

    '''
    int ans = nums[0];
    for (int i = 0; i < nums.size(); i++){
    if(ans ^ nums[i + 1] != 0) return ans;
    else {ans = nums[i + 2]; i++;}
    }
    '''


Log in to reply
 

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