Simple Javascript codes in Sum method


  • 0
    S
    var missingNumber = function(nums) {
        const N = nums.length;
        return N * (N + 1) / 2 - nums.reduce((a, b) => a + b, 0);
    };
    

Log in to reply
 

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