25
4
In as few bytes as possible, sort the input, a delimited string OR list/vector/array of words, words contain printable ASCII except space (ASCII values 33-126) into a numbered list, table, or something resembling a table, by length.
Table rules are as follows:
- Order is mandatory, direction is optional, either labelled rows from shortest to longest or vice versa,
- Formatting is not the challenge. So as long as the output is some form of numerically labelled rows of words, a numbered list, or a list of lists, or similar output, then it is a satisfactory answer.
- including/excluding gaps (NA values, see below examples for both methods of output)
- Word case is untouched. How the word appears in input should be shown in output.
Input 1:
Code Golf and Coding Challenges Meta
or
("Code","Golf","and","Coding","Challenges","Meta")
or similar
Output 1:
1. NA
2. NA
3. and
4. Code Golf Meta
5. NA
6. Coding
7. NA
8. NA
9. NA
10. Challenges
or
3. and
4. Code Golf Meta
6. Coding
10. Challenges
or
[[3, ['and']], [4, ['Code', 'Golf', 'Meta']], [6, ['Coding']], [10, ['Challenges']]]
Input 2:
My v3ry 3xc3113nt m0th3r ju5t 53rv3d u5 nin3 pizz@5 #JusticeForPluto
Output 2:
1. NA
2. My u5
3. NA
4. v3ry ju5t nin3
5. NA
6. m0th3r 53rv3d pizz@5
7. NA
8. NA
9. 3xc3113nt
10. NA
11. NA
12. NA
13. NA
14. NA
15. NA
16. #JusticeForPluto
or
2. My u5
4. v3ry ju5t nin3
6. m0th3r 53rv3d pizz@5
9. 3xc3113nt
16. #JusticeForPluto
or
[[2, ['My', 'u5']], [4, ['v3ry', 'ju5t', 'nin3']], [6, ['m0th3r', '53rv3d', 'pizz@5']], [9, ['3xc3113nt']], [16, ['#JusticeForPluto']]]
More examples can be provided if necessary but I think this should suffice for now. Please ask questions if you have them, this is my second attempt at a challenge. (the first failed dramatically)
In your second example, it seems that
@
is part of a word, but.
is not, and#
is. Could you please define what a "word" means? Thanks. – HyperNeutrino – 2019-11-13T18:02:36.360@HyperNeutrino Sorry, I meant to delete that period. I'll make some edits – Sumner18 – 2019-11-13T18:06:34.903
1Can the length be in unary? – my pronoun is monicareinstate – 2019-11-14T02:14:49.050
@someone I'm unfamiliar with unary outputs. I'd have to see it to confirm, but I imagine it can be a valid answer. – Sumner18 – 2019-11-14T13:54:13.410