Wildcard Matching — Rust Coding Problem
Difficulty: hard | Category: dynamic-programming
Problem Description
Given an input string `s` and a pattern `p`, implement wildcard pattern matching with support for `?` and `*`. - `?` Matches any single character. - `*` Matches any sequence of characters (including the empty sequence). The matching should cover the entire input string (not partial). **DP state:** `dp[i][j]` = whether `s[0..i)` matches `p[0..j)`.
Examples
Example 1
Input: s = "aa", p = "a"
Output: false
Example 2
Input: s = "aa", p = "*"
Output: true
Example 3
Input: s = "cb", p = "?a"
Output: false