leetcode 10 regular expression matching
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.
1 | '.' Matches any single character. |
The matching should cover the entire input string (not partial).
Note:
scould be empty and contains only lowercase lettersa-z.pcould be empty and contains only lowercase lettersa-z, and characters like.or*.
Example 1:
1 | Input: |
Example 2:
1 | Input: |
Example 3:
1 | Input: |
Example 4:
1 | Input: |
Example 5:
1 | Input: |
solution one
recursion
1 | class Solution { |