public boolean anagram(String s, String t) {
        // write your code here
        if (s.length() != t.length())
            return false;
        // constant space, space complexity is O(1)
        int[] count = new int[256];
        for (int i = 0; i < s.length(); ++i) {
            count[s.charAt(i)] += 1;
        }
        for (int i = 0; i < t.length(); ++i) {
            count[t.charAt(i)] -= 1;
            if (count[t.charAt(i)] < 0)
                return false;
        }
        return true;
    }