I just don’t get how to handle the whitespace. The rules explanation is lacking, and the test results aren’t clear what it is supposed to be doing. I can’t paste the test with the whitespace in this textbox apparently so I will try to describe what happens in test 8 with words I guess.
In the results list there is supposed to be a string in the middle “ei_”. Mine is “ei__”. So I can trim one space of the end but then there are other strings toward the end in the result like “n” “e” “.” that trim up to 3 spaces off the end. How do I know how many spaces to trim from the right, I’m just not getting the rules here.
I don’t really understand what you are saying. Before I do any trimming they are all 4 chars long. Some of them are supposed to end up one char long WITH NO whitespace at the end and some are supposed to be 3 chars long WITH a space at the end.
From the bottom to the top, each line is at least as long as the line below it. If it is shorter than the line below, it is padded to be the same length.
Suppose the result looks like this (replacing all chars with #):
###
#
##
Note the middle line is shorter than the line below it. As such, it needs to be padded to be at least as long as the bottom line. So you’d need to pad it to get this:
This has given me some ideas. I need to pad with a different char than space so I can see which was added padding and then which was original to the strings. Then I need to remove any of this “padding” from the right side but leave any from the left. It’s that second part that’s hanging me up now.
I don’t think the each row at least as long as the next will work with my algorithm. Not in any way I can figure out anyway.
i am sure that will be the result once i get it to work I just don’t see how I enforce that in any way except implicitly, ie: when I do what I said with the chars it will be that way
Anyway what helped me with the rules is this: All original spaces must be preserved. All added padding on the right must be removed but preserved on the left. Maybe that will help someone else confused by the rules.