question
Devise an algorithm to determine if two strings of letters are anagrams.

ex. isAnagram(Debit Card, Bad Credit)
returns true

ex 2. isAnagram(Eleven Plus Two, Twelve Plus One)
returns true

ex 3. isAnagram(Hello, World)
returns false
An O(n) solution exists. Think of how to count the letters.
The general algorithm that runs in O(n) is as follows:

1. Create an integer array of size 26 with all values initialized to 0
2. Traverse through each character in the first string, incrementing each position in the array corresponding to the character
3. Traverse through each character in the second string, decrementing each position in the array corresponding to the character
4. Scan through the array: If all elements equal 0 then the two strings are anagrams.


isAnagram(String s1, String s2)
    if (s1.length() != s2.length())
       return false;

    int[] counter = new int[26];

    for i = 0 through s1.length() - 1
       int letter = (int) s1.charAt(i); // Convert letter to ASCII format
       if (letter >= 65 || letter <= 90)
          counter[letter - 65]++;

    for i = 0 through s2.length() - 1
       int letter = (int) s2.charAt(i);
       if (letter >= 97 || letter <= 122)
          counter[letter - 97]--;

    for i = 0 through s1.length() - 1
       if (counter[i] != 0)
          return false;

    return true;