-
[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.

'Life > PS' 카테고리의 다른 글
[LeetCode] 30. Substring with Concatenation of All Words (0) 2026.05.22 [LeetCode] 23. Merge k Sorted Lists (0) 2026.05.18 [LeetCode] 4. Median of Two Sorted Arrays (0) 2026.05.14 트리의 지름: Diameter of Tree (0) 2026.03.30 백준 1956번 운동 (0) 2026.02.19