"baabbbaccbccacacc", "c*..b*a*a.*a..*c", the answer is true

  • 0

    I just don't understand why this test case is true, 'c*' will not match any character, then the two '.' will match "ba", then 'b*' match nothing, then 'a*' match "a", then 'a' can't match "b", but why the answer is true. Im confused about this.

  • 1
    1. nothing->c* (zero c)
    2. b->'.'
    3. a->'.'
    4. nothing->b*(zero b)
    5. nothing->a*(zero a) THE KEY IS THIS STEP
    6. a->'a'
    7. bbb->'.*'
    8. a->'a'
    9. c->'.'
    10. cbccacac->'.*'
    11. c->c

Log in to reply

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