modified anagrams in consistent with leetcode, accepted