Ok. I got the impression that you are kind of lost. Hence to get you started here how you may approach your task:
- define a
dictionary
containing all words you will accept. - make sure the newly created string (in your case I guess
arr2
) is composed of the same characters as the original word (in your case I guessarr1
) - if your validation succeeds, lookup the newly created string in your
dictionary
and if it exists, it is an anagram. Otherwise it is not.