Using set() here is unnecessary.  Construction of the set will take more time than O(n) lookup in a list.