Question about the test case of only one word


  • 1
    C

    For the text justification, I noticed one test case is like:

    Input:
    ["a"]
    2

    Expected output:
    ["a "]

    However, in the original question, it says "For the last line of text, it should be left justified and no extra space is inserted between words", which means the last line is a special one - it does not need to be exactly the said length (that's what left justified means). I think the answer should simply be ["a"].

    Comments?
    Thanks.


  • 0

    "For the last line of text, it should be left justified and no extra space is inserted between words"

    It says no extra spaces "Between the words", not "After words". So you should append extra spaces after words if necessary for the last line.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.