Uiua
You can run this in Uiua Pad
"987654321111111\n811111111111119\n234234234234278\n818181911112111"
βββΈβ @\n
Jolt β β₯(βββ
ββ+1β(β(Λβ‘|Λββ+β)βββ(Λβ¨βΈ/β₯)))β(+1Β―)
β©/+ββ‘(βJolt2)β‘(βJolt12)
::: spoiler Explanation You're always looking for the highest digit far enough from the end of the string that there's space to pick the remaining number of digits. So the algorithm is very straightforward: just temporarily exclude the last n-1 characters off the end of the string and look for the first instance of the largest digit in that substring, store that char and behead the string at that point. Repeat n times.