Okay, here's the thing: That's not actually what your example seems to be doing. If you have a b a Then the second a should go in the first column, right? If not, then this is trivial. If so, then the input is all…
Also, the formatting was goofed up, sorry about that. Really isn't too bad a problem when you think about it in terms of, where do things go when you print them, and where is the cursor. That's what x and i are…
Okay, here's the thing: That's not actually what your example seems to be doing. If you have a b a Then the second a should go in the first column, right? If not, then this is trivial. If so, then the input is all…
Also, the formatting was goofed up, sorry about that. Really isn't too bad a problem when you think about it in terms of, where do things go when you print them, and where is the cursor. That's what x and i are…