Match a whole string against a pattern where ? matches any single character and * matches any sequence (including empty). Implement:
match_dp(s, p): dynamic programming over prefixesmatch_greedy(s, p): the O(1)-space greedy algorithm that remembers the last * and backtracks to it on mismatchUnlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial