1 Line Simple JavaScript Solution


  • 0
    G

    var missingNumber = function(nums) {
    return nums.length * (nums.length + 1) / 2 - nums.reduce((rs, cv) => rs + cv, 0);
    };


Log in to reply
 

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