How could you design an efficient algorithm that uses the least amount of memory space and outputs, in ascending order, the list of integers in the range 0..255 that are not in a randomly generated list of 100 integers?
The aim is to output the number of such integers, and determine if the randomly generated list of 100 integers included any repeats.
The naive approach would be to compare each number from 0 to 255 against the list of 100 integers. This would not be very efficient.
What would be a more efficient approach to solve this?