terminal
Elevo
/
ESC
Login
Initiate Registration
code
Topics
corporate_fare
Companies
history
History
arrow_back
Back to Challenges
#268
Missing Number
Easy
Acceptance 0%
Editorial
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
Python 3
expand_more
C
C++ 17
Java
JavaScript
Python 3
C
C++ 17
Java
JavaScript
Python 3
refresh
class Solution: def missingNumber(self, nums: list[int]) -> int: pass
Login to Compile
Processing
terminal
Debug Output
home
Home
extension
Practice
robot_2
login
Sign In
account_circle
Menu
code_blocks
Coding
psychology
Aptitude
Navigation
close
Login
Registration