public boolean compareStrings(String A, String B) {
        // write your code here
        int[] count = new int[256];
        for (int i = 0; i < A.length(); ++i) {
            count[A.charAt(i)] += 1;
        }
        for (int i = 0; i < B.length(); ++i) {
            count[B.charAt(i)] -= 1;
            if (count[B.charAt(i)] < 0)
                return false;
        }
        return true;
    }