Ly, 46 29 bytes
iayr>iay&s<l[0I=![0u;]pprp]1u
Try it online!
I know Ly
better now. :) At a high level, this code constructs two stacks, each with a sorted (by codepoint) list of characters in the associated input string, with the length of the string included as another entry on the list.
One stack is reversed and then the two are concatenated. Once that setup is done, the code loops comparing the top and bottom of the stack. The first time the codepoints aren't the same, the code write out a 0
and exits. If the loop exhausts the stack, the strings are anagrams so the code writes out a 1
and exits.
It's still nowhere near the shortest, but the way it works might be interesting to people?
# parse the first string
i - read in one line
a - sort by codepoint value
y - push the stack length
r - reverse the stack
# parse the second string
> - switch to a new stack
i - read in one line
a - sort by coidepoint
y - push the stack length
&s - stash the entire stack
# setup for processing
< - back to stack with string 1
l - append the parsed second string
# compare pairs of codepoints while stack isn't empty
[ ] - loop, process one char per iteration
0I - copy bottom of stack
=! - compare top two negate
[ ]p - if/then, if they don't match
0u; - print "0" and exit
prp - delete pair we just checked
# if lengths and all the codepoints matched...
1u - success! print "1"
aaab, bbba = false
\$\endgroup\$