Angad Sandhu
Search
Browse

268_Missing_Number

Source name
268_Missing_Number.py
# File: Leetcode/Solutions/268_Missing_Number.py

"""
Problem Number: 268
Problem Name: Missing Number
Difficulty: Easy
Tags: Bit Manipulation, Math, XOR, Neetcode 150
Company (Frequency): Amazon, Google, Facebook, Microsoft, Apple
Leetcode Link: <https://leetcode.com/problems/missing-number/description/>

DESCRIPTION

Given array of n distinct numbers in [0,n], find the missing number.
Approaches:

* XOR trick, sum formula n*(n+1)/2 minus sum(nums), or bitwise.
"""

Browse the library