Simple C Solution


  • 0
    T

    int missingNumber(int* nums, int numsSize) {

    int sum = 0;
    
    for (int i = 0; i < numsSize; i++) {
      sum += nums[i];
    }
    return sum - numsSize * (numsSize + 1) / 2;
    

    }


Log in to reply
 

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