Coding Challenge

Missing Number

Easy
arraymathbit-manipulation

Find the missing number from 0..n.

The input contains n distinct numbers taken from the range [0, n]. Return the one number from the range that does not appear.

Examples

Input: nums = [3,0,1]

Output: 2

Constraints

  • n == nums.length

Preparing your coding workspace...