Hard · Dynamic Programming
Regular Expression Matching
Given a string s and a pattern p in which '.' matches any single character and '*' matches zero or more copies of the element just before it, return true if p matches the entire string s (not just a prefix), else false.
Examples
Example 1
{
"s": "aa",
"p": "a*"
}Output: true
Example 2
{
"s": "ab",
"p": ".*"
}Output: true
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.