Regular Expression Matching
Hard
Strings
Dynamic Programming
Recursion
Implement regex matching with '.' and '*'.
Input line 1: string
Input line 2: pattern
Output: true/false
Constraints
See problem-specific constraints. Optimized solution required.
Examples
Example 1:
Input: aa
a*
Output:
Example 2:
Input: aa
a*
Output:
Hints
Consider a dynamic programming approach.
Think about time complexity.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console