Draft
Regular Expression Style Matching
5 of 6ChrisKalahiki
Description:
Given an input string s
and a pattern p
, implement regular expression style matching with support for .
and *
.
.
Matches any single character.
*
Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
Here's the catch:
To ensure a challenge, the re
module for Python will not be permitted.
Note:
- s could be empty and contains only lowercase letters a-z.
- p could be empty and contains only lowercase letters a-z, and characters like . or *.
Example 1:
Input:
s = "aa"
p = "a"
Output: false
Explanation: "a" does not match the entire string "aa".
Example 2:
Input:
s = "aa"
p = "a*"
Output: true
Explanation: '*' means zero or more of the precedeng element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".
Regular Expressions
Similar Kata:
Stats:
Created | Apr 3, 2019 |
Warriors Trained | 30 |
Total Skips | 0 |
Total Code Submissions | 23 |
Total Times Completed | 6 |
Python Completions | 5 |
Total Stars | 0 |
% of votes with a positive feedback rating | 0% of 2 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 4 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |