...

/

Solution: Missing Number

Solution: Missing Number

Let's solve the Missing Number problem using the Cyclic Sort pattern.

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
  • 1n1031 \leq n \leq 10^3
...