// Given an array of integers, every element appears twice except for one. Find that single one.


var singleNumber = function(nums) {
    var result;
    for(var i=0; i<nums.length; i++)
    {
        result ^= nums[i];
    }
    return result;
};

var singleNumber = function(nums) {
    return nums.reduce((a,b) => a^b);
};

// return input if length is less than 1
// create a hash map
// loop through nums input
  // set the key value pairs of th hash map
  // if the current nums value is undefined set it to 1
  // if it is created, add 1
// loop through hash map
// if the value is equal to 1 return the key


var singleNumber = function(nums) {
    if(nums.length<1) return nums;

    var map = {};
    for(var i=0;i<nums.length;i++){
        if(map[nums[i]] === undefined){
            map[nums[i]] = 1;
        }
        else{
            map[nums[i]] += 1;
        }
    }
    for(var key in map){
        if(map[key] === 1){
            return Number(key);
        }
    }
};

@@ -91,16 +91,188 @@
 e one.%0A%0A
+// Logic: XOR will return 1 only on two different bits. So if two numbers are the same, XOR will return 0.%0A// Finally only one number left.%0A// A %5E A = 0 and A %5E B %5E A = B.%0A
 %0Avar sin
@@ -352,21 +352,16 @@
 th; i++)
-%0A    
 %7B%0A      

add logic