According with the speed test, I think is better to uset dictionaries,
rather than sets transforms and list (at leat for this problem :) )