Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Missing Number

An array A contains all the integers from 0 to n, except for one number which is missing. In this problem, we cannot access an entire integer A with a single operation. The elements of A are represented in binary, and the only operation we can use to access them is "fetch the kth bit of A[i]"m which takes constant time. Write code to find the missing integer.

Solutions:

Swift

O(n)

C++

O(n)

Installation

Run make to build and run C++ files and run Swift files. Or you can run .playground file.