Should “a*b” matches “aa”?


  • 0
    Y

    I used several codes which is accepted, the answers are all false. Why they didn't match. I misunderstood the question?


  • 0

    No, “a*b” doesn't and shouldn't match “aa”. No idea why you think it might.


  • 0

    In the examples provided below the question, "aab" and "cab", return true. Why "aab" and "cab" matches please?


  • 0
    S

    '' Matches zero or more of the preceding element.
    a
    b means a can appear zero or more,
    "cab" means c and a can appear zero or more


Log in to reply
 

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