Solution: Wildcard Matching
Understand how to apply a greedy algorithm to solve the wildcard matching problem, which supports '?' and '*' characters. Explore pointer techniques to scan and match patterns against input strings efficiently, ensuring complete pattern coverage. This lesson helps you implement and optimize a solution with linear time complexity and constant space usage.
We'll cover the following...
Statement
Given an input string, s, and a pattern string, p, implement wildcard pattern matching that determines if the pattern matches the entire input string.
The pattern supports two special wildcard characters:
'?': Matches exactly one arbitrary character.'*': Matches any sequence of characters (including zero characters).
The match must be complete, meaning the pattern should cover the entire input string, not just a part of it.
Return TRUE if the pattern matches the whole string; otherwise, return FALSE.
...