The question is not clear enough

  • 2

    When I first working on this question, I just convert it to word array, reverse it, then join them together, it gives me errors for the case ' ' should be '', not ' '. I think the question is not making it clear that you should trim the white spaces.
    I believe what it actually wants is ' this is a tree ', should be 'tree a is this', should trim the extra space in between. This should be decalred more clear in the question.

Log in to reply

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