arrow_back Back to Challenges

#268 Missing Number

Easy Acceptance 0%
description

Problem Description

Given an array `nums` containing `n` distinct numbers in the range `[0, n]`, return the only number in the range that is missing from the array.

checklist Constraints

n == nums.length
1 <= n <= 10^4
0 <= nums[i] <= n
All the numbers of nums are unique.

science Examples

Case #1

In: nums = [3,0,1]
Out: 2

Case #2

In: nums = [0,1]
Out: 2

Mastery Tags

Arrays Bit Manipulation Math

Hiring Companies

Amazon Apple Microsoft
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude