Wildcard Matching

Given an input string s and a pattern p, implement wildcard pattern matching with support for '?' and '*'. '?' matches any single character and '*' matches any sequence of characters (including the empty sequence). The matching should cover the entire input string.

Constraints

  • 0 <= s.length, p.length <= 2000
  • s contains only lowercase English letters.
  • p contains only lowercase English letters, '?' or '*'.
Saving… · 2 lines
class Solution:
def wildcardMatching(self, s: str, p: str) -> bool:
Console

Click Run to execute sample tests.