Should “a*b” matches “aa”?

  • 0

    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

    '' Matches zero or more of the preceding element.
    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.