text and a pattern pattern made of lowercase English letters and at least one star *. Each star may be replaced with any string, including the empty one; different stars are replaced independently.
Return True if the stars can be replaced so that the pattern turns into a contiguous piece of text, and False otherwise.text='blackboard', pattern='ac*oa' → True
Replace the star with "kb" to get "ackboa", which is a piece of the text.
text='window', pattern='w*x' → False
The text has no "x", so no replacement can help.
text='lemon', pattern='m*' → True
The star may become the empty string: "m" occurs in the text.
text.length ≤ 50pattern.length ≤ 50text consists of lowercase English letterspattern consists of lowercase English letters and contains at least one *text='blackboard', pattern='ac*oa'
True
Run checks the first 3 tests in your browser. Submit checks all 212 tests on the server, hidden ones included.