Code that checks if two words are anagrams
The algorithm in isAnagram is far from being efficient. 

Consider two strings: each is a letter "a" repeated 1000 times. We will count the occurrences of 'a' in both strings 1000 times - each time getting the same answer. In other words, the worst case complexity is O(len(input)^2). 

It's possible to cache the number of occurrences of a given character in a Map while retaining the rest of your current algorithm. This would speed up most cases, but the worst case complexity will still be O(len(input)^2) (consider an anagram where no letter occurs twice, and is a reverse of the first string).

What we could do is something like this:


Iterate once through each string to create a HashMap with the count of each character's occurrences.
If the two maps are equal, we have an anagram. Otherwise, we don't. 


The complexity would be O(len(input1) + len(input2)).