← All problems

Missing Number

EasyMath

Given an array containing n distinct numbers in [0, n], return the one number that is missing.

Examples

Input: [3,0,1]
Output: 2
Input: [9,6,4,2,3,5,7,0,1]
Output: 8

Hints

Solution

Language:
Loading editor…
Output0 lines
Run your code to see output here.
Click Run all tests to check your solution against 4 test cases.