# Leetcode 44 - Wildcard matching

`Note:`

- Just like leetcode 10, use dfs with memo.
- There are several tricky test cases that you need to take care of
`('', '*******')`

`('', '?')`

. ? cannot represent an emtpty char.

- If
`p[j] == '*'`

- If
`i >= sLen`

,`*`

can be ignored, so let’s jump cur p[j], and do`dfs(i, j + 1)`

. - If
`i < sLen`

, there are three options:- Let * represent more than one char, Jump to next char of s -
`dfs(i + 1, j)`

- Ignore cur char of p -
`dfs(i, j + 1)`

. - Accept * only once,
`dfs(i + 1, j + 1)`

- Let * represent more than one char, Jump to next char of s -

- If
- If
`p[i] != '*'`

- Do a match check if
`s[i] === p[j]`

or`(p[j] === '?' && s[i] !== "" && s[i] !== undefined)`

. - For cases like`'', '?'`

. - Check
`(i + 1, j + 1)`

.

- Do a match check if

`Question:`

Given an input string (`s`

) and a pattern (`p`

), implement wildcard pattern matching with support for `'?'`

and `'*'`

where:

`'?'`

Matches any single character.`'*'`

Matches any sequence of characters (including the empty sequence).

The matching should cover the entire input string (not partial).

`Example:`

1 | Input: s = "adceb", p = "*a*b" |

`Code:`

1 | /** |