Skip to main content
1 of 2
Alex A.
  • 24.7k
  • 5
  • 38
  • 119

Julia, 112 bytes

s->(x=[sum(i->i==10,s),endof(split(s,r"\s",keep=1<0)),sizeof(s)];join(map(i->lpad(i,maximum(ndigits,x)),x)," "))

This is an anonymous function that accepts a string and returns a string. To call it, assign it to a variable.

My internet went out right before I was going to post this so I'm posting from mobile. I'll add an explanation once my internet comes back. :/

Alex A.
  • 24.7k
  • 5
  • 38
  • 119