"" returns 0 and " " returns 1

  • 0

    I was testing the question, noticed that input "" returns 0 and " " returns 1.
    shouldn't they be considered the same? If not, can anyone explain to me why?

  • 1

    I think we can assume that the input contains strictly digits.

    I guess the solution has something like if len(s) == 1: return 1

Log in to reply

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