I think the creation of a dict was not necessary here. We could transform the array into a set to get rid of duplicated entries. So do the split(), add all the additional specified entries via the option, and call set() on the array. Then we can call join() on the set.