left and right. In one move you may append any letter to the end of either string. Letters cannot be removed or changed.
Return the fewest moves after which the two strings are anagrams of each other, that is, they hold the same letters in the same quantities.left="star", right="rats" → 0
The strings already hold the same letters.
left="apple", right="leap" → 1
right needs one more p, left needs nothing.
left="xy", right="zz" → 4
Append zz to left and xy to right: 4 letters in total.
left="star", right="rats"
0
Run checks the first 3 tests in your browser. Submit checks all 105 tests on the server, hidden ones included.