String-dp

1 articles

dsa9 min read

Wildcard Matching — String DP with `?` and `*` Done Cleanly

LeetCode 44 Wildcard Matching is the classic 2D string DP question Meta and Google ask to test recurrence design under tricky base cases. We derive the dp[i][j] transitions for ? and *, dry-run a full table, and finish with a two-pointer optimization that drops memory to O(1).

Read →