I have been stuck on Transpose for longer than I would like to admit.
My current issue is with test_mixed_line_length. The expected result is made up of rows from the columns of the input, but the some of the rows are trimmed on the right, while others, such as "h ", are not. (See the example below)
I assume that the issue is to trim so no later row is longer. That is, as long as there is a row of length n non-blanks ahead, pad this row to n. Once all later rows can be trimmed, reduce row length.
But the problem statement says:
“In general, all characters from the input should also be present in the transposed output. That means that if a column in the input text contains only spaces on its bottom-most row(s), the corresponding output row should contain the spaces in its right-most column(s).”
I read this to say “Don’t trim on right”.
Suggestions?
Here is the expected result:
expected = [
“TAAA”,
"h “,
“elll”,
" ooi”,
“lnnn”,
“ogge”,
“n e.”,
“glr”,
"ei “,
“snl”,
“tei”,
" .n”,
“l e”,
“i .”,
“n”,
“e”,
“.”,
jdp