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.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.