823. Missing Number
0
Medium
Given an array nums containing n distinct numbers in the range [0, n], find the missing number in the range.
Input Format
You are given n, the number of integers in the array nums, followed by n integers.
Output Format
Return the missing integer.
Example
Input
3
3 0 1
Output
2
Constraints
n == nums.length
1 <= n <= 10^4
0 <= nums[i] <= n
All the numbers of nums are unique.
0 <= nums[i] <= n
All the numbers of nums are unique.
Loading...
View Submissions
Console