Fixed commonCharacters so that it does not return duplicate characters