Given a text and a wildcard pattern, implement wildcard pattern matching algorithm that finds if wildcard pattern is matched with text. The matching should cover the entire text (not partial text).
The wildcard pattern can include only ? – matches 0 or 1 of previous character.
Example 1:
Input: pattern = "be?t", text = "bet"
Output: trueExample 2:
Input: pattern = "ton?e?", text = "'to"
Output: trueExample 3:
Input: pattern = "ton?e?", text = "tonne"
Output: falseRelated problems: