This is correct, but try using Python Set type for this task.