Result

AC

Duration

1180ms

Code [DL]

sed ':L
s/\(.\)9/\1\18/
s/\(.\)8/\1\17/
s/\(.\)7/\1\16/
s/\(.\)6/\1\15/
s/\(.\)5/\1\14/
s/\(.\)4/\1\13/
s/\(.\)3/\1\12/
s/\(.\)2/\1\1/
tL'

stdin

hf9t3e2y7l3e7a7s7c9q9m2p4e5e6bnsl5w8w5b6qy3i5e4y9j6u9v5z7z8i4d3f8l6o3r2d9j4ka6mv5x4g5kh7uh8

stdout

hfffffffffttteeyyyyyyyllleeeeeeeaaaaaaassssssscccccccccqqqqqqqqqmmppppeeeeeeeeeeebnslllllwwwwwwwwwwwwwbbbbbbqyyyiiiiieeeeyyyyyyyyyjjjjjjuuuuuuuuuvvvvvzzzzzzzzzzzzzzziiiidddffffffffllllllooorrdddddddddjjjjkaaaaaamvvvvvxxxxgggggkhhhhhhhuhhhhhhhh

stderr

strace