Given a read only array of n + 1 integers between 1 and n, find one number that repeats in linear time using less than O(n) space and traversing the stream sequentially O(1)
std::vector isn't like any other vector.
std::vector
std::vector is a possibly space-efficient specialization of std::vector for the type bool.
bool
That's why it may use up less memory because it might represent multiple boolean values with one byte, like a bitset.