Unique Numbers 3

The hint given in the video works only if the numbers given to us are ranging from 0 to 7. What if the numbers were bigger than that?