I can't understand my error.

  • 0

    In the examples: isMatch("ab", ".*") → true and isMatch("aab", "c*a*b") → true
    but mysubmissions: 337/439 test cases passed
    Input: "ab", ".*c"
    Output: true
    Expected: false
    Can someone tell me what my misunderstanding of the question is?

  • 0

    "." means any character.

    ".*" means any sequence of characters (any string, even the empty one)

    ".*c" means any sequence of characters followed by the character c. Here are a few example of strings that should match: c, xc, xyc, xyzc, etc…

Log in to reply

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