Added function "hasSimilarRareWords" in Algorithm