If this is able to help you to understand some test cases

  • 0

    I see many are confused by some test cases (e.g., isMatch("aab", "c*a*b") is true) because of, in my opinion, the "unconventional" fuzzy match defined by type <char>*, where <char> is a "concrete" alpha char (instead of '.'). The rule is that fuzzy match type <char>* can match string of length 0 even if <char> is a "concrete" alpha char, which seems very unnatural to many (including myself initially). Because in the "conventional" sense of regular expression, char '*' alone is able to match any string of any length without any prefix. However, this problem here is defined in a different way (for enhanced logic complexity, I guess)

Log in to reply

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