set() is faster than list in this case, so use set()