Tap here to switch tabs
Problem
Submissions

Problem: Missing Number

Missing Number gives an array of distinct values from zero through its length, with exactly one value absent. Return the missing value.

Statement

Given an array, nums, containing nn distinct numbers in the range [0,n][0, n], return the only number in the range that is missing from the array.

Constraints:

  • n=n = nums.length
  • 1≤n≤1031 \leq n \leq 10^3
  • 0≤0 \leq nums[i] ≤n\leq n
  • There are no duplicates in the array.
⋮
Tap here to switch tabs
Problem
Submissions

Problem: Missing Number

Missing Number gives an array of distinct values from zero through its length, with exactly one value absent. Return the missing value.

Statement

Given an array, nums, containing nn distinct numbers in the range [0,n][0, n], return the only number in the range that is missing from the array.

Constraints:

  • n=n = nums.length
  • 1≤n≤1031 \leq n \leq 10^3
  • 0≤0 \leq nums[i] ≤n\leq n
  • There are no duplicates in the array.