Wrong answer said by OJ but I think it's correct


  • -2
    F

    Input: ["What","must","be","shall","be."], 12

    For this input, my output is:
    Output: ["What must be","shallbe. "]

    OJ:
    Expected: ["What must be","shall be. "]

    But actually according to the problem specification, since word "shall" and "be" can be put in a line and it is the last line, this line should be left justified and no extra space is inserted between words. Can any one explain this to me?


  • 3
    F

    I got it. No extra space does not mean no space at all. There still should be one space between words in the last line


Log in to reply
 

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