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