Easy · Arrays & hashing

Missing Number

You are given n different whole numbers taken from 0 to n, so exactly one number in that range is missing. Return the missing one.

  • Every number appears once.
  • The numbers are in no particular order.
  • Try it without sorting and without extra space.
nums = [3, 0, 1]

→ 2
Record your take

No one has solved it yet.