Uber | Phone Screen | Wildcard Pattern Matching

Anonymous User
1237
Nov 05, 2019
Nov 06, 2019

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: true

Example 2:

Input: pattern = "ton?e?", text = "'to"
Output: true

Example 3:

Input: pattern = "ton?e?", text = "tonne"
Output: false

Related problems:

Comments (4)