Why when input is " ", expected is ""?


  • 33

    I got "Wrong answer" as:
    Input: " "
    Output: " "
    Expected: ""

    I think for input " ", the output is supposed to be " " when reversing the string, am I missing something here?


  • 2
    X

    According to the clarification, result should not contain leading or ending spaces. Therefore, when given word list is none, we might expect empty string.


Log in to reply
 

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