Added a method to convert the dictionary ArrayList into a HashSet for O(1) lookup time.