2 bit operations/missing character/main.cpp
//Given an array nums containing n distinct numbers in the range [0, n], 
//return the only number in the range that is missing from the array. 
Given an array nums containing n distinct numbers in the range [0, n],
return the only number in the range that is missing from the array.
Given an array nums containing n distinct numbers in the range [ 0 n ] return the only number in the range that is missing from the array .
int missingNumber(vector<int>& nums) {
    int sum1 = 0;
    int sum2 = 0;
    for(int i = 1; i <= nums.size();i++){
        sum1 = sum1 ^ i;
    }   
    for(int i = 0; i < nums.size();i++){
        sum2 = sum2 ^ nums[i];
    }   
    return sum1 ^ sum2;  
}
int missingNumber ( vector < int > & nums ) { int sum1 = 0 ; int sum2 = 0 ; for ( int i = 1 ; i <= nums . size ( ) ; i ++ ) { sum1 = sum1 ^ i ; } for ( int i = 0 ; i < nums . size ( ) ; i ++ ) { sum2 = sum2 ^ nums [ i ] ; } return sum1 ^ sum2 ; }
Given an array nums containing n distinct numbers in the range [0, n],
return the only number in the range that is missing from the array.
Given an array nums containing n distinct numbers in the range [ 0 n ] return the only number in the range that is missing from the array .
/*
    for(int i=1;i<=nums.size();i++){
            sum1 = sum1 ^ i;
            sum2 = sum2 ^ nums[i-1];      
    }
    */