split isDistinctAnagram into isDistinct and isAnagram