Skip to content

Commit feedb44

Browse files
committed
Time: 298 ms (8.35%), Space: 16.5 MB (54.13%) - LeetHub
1 parent bc1375b commit feedb44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import re
2+
3+
class Solution:
4+
def isMatch(self, s: str, p: str) -> bool:
5+
compact = re.sub(r"\*+", '*', p)
6+
return re.match(f"^{compact}$", s)

0 commit comments

Comments
 (0)