Wildcard Matching — Solution & Editorial
DP over prefixes: dp[i][j] = whether T[..i] matches P[..j]. A * either consumes a text character (dp[i−1][j]) or matches empty (dp[i][j−1]); ? and equal characters advance both.
Complexity: O(|T|·|P|)
DP over prefixes: dp[i][j] = whether T[..i] matches P[..j]. A * either consumes a text character (dp[i−1][j]) or matches empty (dp[i][j−1]); ? and equal characters advance both.
Complexity: O(|T|·|P|)