If string s[i] is '0' and s[i-1] is '9' , shall we ignore the '0' and jump '0'?


  • 0
    P

    if string s[i] is '0' and s[i-1] is '9' , shall we ignore the '0' and jump '0'?

    Then what about '10'? Why answer is 1 decode way?


  • 0

    If string ends with 90, it cannot be matched at all. Is that what you are asking?

    For "10", it must be J -> 10 (one and only way), since you cannot match a single 0.


Log in to reply
 

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