Implement regex matching supporting '.' (any single char) and '*' (zero or more of preceding element). Must match the entire string.
2D DP: dp[i][j] = True if s[:i] matches p[:j]. Handle '*' by either using 0 occurrences (dp[i][j-2]) or matching one more (dp[i-1][j] if chars match).
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
isMatch('aa', 'a*')
True
isMatch('ab', '.*')
True
isMatch('aab', 'c*a*b')
True