Use sets instead of arrays.