###GolfScript, 50 characters### {[[\].zip{1/~=},,\{$}/{1$?.)!!{)>0}*)},,\;1$-]}:M; A similar solution to [chron's answer](http://codegolf.stackexchange.com/a/12490) written in GolfScript. Input must be provided as two strings on the stack, the result will be the array `[A B]`. [Examples](http://golfscript.apphb.com/?c=e1tbXF0uemlwezEvfj19LCxceyR9L3sxJD8uKSEheyk%2BMH0qKX0sLFw7MSQtXX06TTsKCiIxMjU0IiAiMTM0MiIgTSBwICAgICMgPT4gWzEgMl0KIjEyMzQiICIxMTExIiBNIHAgICAgIyA9PiBbMSAwXQoiNTQ0MSIgIjEyMzQiIE0gcCAgICAjID0%2BIFswIDJdCiI1NDQxIiAiNDUzMSIgTSBwICAgICMgPT4gWzEgMl0KIjU0NDEiICI0NDQxIiBNIHAgICAgIyA9PiBbMyAwXQoiNTQ0MSIgIjU0NDEiIE0gcCAgICAjID0%2BIFs0IDBdCg%3D%3D&run=true): "1254" "1342" M p # => [1 2] "1234" "1111" M p # => [1 0] "5441" "1234" M p # => [0 2] "5441" "4531" M p # => [1 2] "5441" "4441" M p # => [3 0] "5441" "5441" M p # => [4 0]