Julia, 112112 81 bytes
f(s->,n=endof,l="$(x=[sumn(i->i==10,s))",endofg=r->lpad(n(split(s,r"\s",keep=1<0)r),sizeof(s)];join(map(i->lpad(i1,maximumn(ndigits,xl)),x),=g(r"\n")" ")"g(r"\S+")" "l
This is an anonymousa function that accepts a string and returns a string. To call it
We save the following as function arguments:
n = endof
function, which gets the last index of an indexable collection (in this case is the length of the string)l = "$(n(s))
, the length of the input converted to a string using interpolation- A lambda function
g
that accepts a regular expression and returns the length - 1 of the input split on that regex, left padded with spaces to match the length ofl
.
We get the number of lines using g(r"\n")
and the number of words using g(r"\S+")
, assign it to a variablethen we join those together with l
delimited by spaces.
My internet went out right before I was goingSaved 31 bytes thanks to post this so I'm posting from mobile. I'll add an explanation once my internet comes back. :/Dennis!