CodeOath
← All problems

Missing Number

Easy
arraysmath

Given n distinct numbers from [0, n], return the one missing.

Example:

Input: nums = [3, 0, 1]
Output: 2