- Take input string separated by space.
- Sort the words alphabetically.
- Print them out vertically in 3 columns separated by space(s).
- All three column's heights should be as evenly weighted as possible.
- All three column's should be left aligned.
This is code-golf, so shortest code wins!
If the input is:
"cat caterpillar pie frog elephant pizza",
The output should be:
cat elephant pie caterpillar frog pizza
Please beware of cases, if input is:
"a b c d e f g"
Should be printed as:
a c e b d f g # or a d f b e g c # and not a d g b e c f