revise isAnagram