Life
-
[LeetCode] 10. Regular Expression MatchingLife/PS 2026. 5. 15. 13:53
Considering a recursive solution. The helper function determines whether s[s_idx:] and p[p_idx:] match. One might worry about a time limit exceeded issue , but since the length is very short, at most 20, it passes within about 500 ms. With memoization, it passes in 0 ms at the cost of using about 10 MB of memory.