Just have one question confusing me since I touched this problem: why there are 6 ways when ending on an open 2. I feel like 2 can be followed by 0 to 6, which would 7 ways instead of 6. What did I miss please?
The problem with Scala submissions persists...
Tried submitting 557. Reverse words in string III, but always exceeds time limit.
Same approach in java and python works no problem.
Must conclude that Scala code functionality is broken, unusable.
Initially I wonder how do you get 15 when both ch1 and ch2 are "*". Then I realize that your ways(i,j) function only consider the case that both characters can be decoded as a whole. So then if the first * represents 1, there are 9 cases (11 12 ... 19); if the first * equals to 2, there are 6 cases (21,22...26)
I believe the Java stack size in leetcode compiler is too small, The biggest length of input string is 10,000, so the stack size will not be bigger than 1M(1w*100); Can @administrators explains what is the Java stack size in Leetcode?