JavaScript solution


  • 0
    Q
    var missingNumber = function(nums) {
        var length = nums.length;
        var temp = Object.keys(Array.apply('',{length:length+1}));
        for(;length>=0;length--){
            delete temp[nums[length]]
        }
        return Number(Object.keys(temp)[0])
    };
    

Log in to reply
 

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