class Main {
if (s.length() != t.length()) return false;
int[] freq = new int[26];
for (int i = 0; i < s.length(); i++) {
freq[s.charAt(i) - 'a']++;
freq[t.charAt(i) - 'a']--;
}
for (int count : freq) {
if (count != 0) return false;
}
return true;
}
public static void main
(String[] args
) {
System.
out.
println(isAnagram
(s, t
) ? "Anagram" : "Not Anagram"); }
}
CmNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzQW5hZ3JhbShTdHJpbmcgcywgU3RyaW5nIHQpIHsKICAgICAgICBpZiAocy5sZW5ndGgoKSAhPSB0Lmxlbmd0aCgpKSByZXR1cm4gZmFsc2U7CgogICAgICAgIGludFtdIGZyZXEgPSBuZXcgaW50WzI2XTsKCiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzLmxlbmd0aCgpOyBpKyspIHsKICAgICAgICAgICAgZnJlcVtzLmNoYXJBdChpKSAtICdhJ10rKzsKICAgICAgICAgICAgZnJlcVt0LmNoYXJBdChpKSAtICdhJ10tLTsKICAgICAgICB9CgogICAgICAgIGZvciAoaW50IGNvdW50IDogZnJlcSkgewogICAgICAgICAgICBpZiAoY291bnQgIT0gMCkgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU3RyaW5nIHMgPSAibGlzdGVuIjsKICAgICAgICBTdHJpbmcgdCA9ICJzaWxlbnQiOwoKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oaXNBbmFncmFtKHMsIHQpID8gIkFuYWdyYW0iIDogIk5vdCBBbmFncmFtIik7CiAgICB9Cgp9Cg==