Given an array nums containing n distinct numbers in the range [0, n], return the one number in the range that is missing from the array.
For example, if nums = [3, 0, 1], the array has 3 elements so the range is [0, 3]. The number 2 is missing.
nums = [3, 0, 1]2nums = [0, 1]2nums = [9, 6, 4, 2, 3, 5, 7, 0, 1]8n == nums.length1 <= n <= 10^40 <= nums[i] <= nAll values of nums are uniqueRun your code to see results
Use Cmd+Enter to run