Wildcard Character Array Match
Problem statement
Given pattern and target, determine whether the array can represent the target string.
Each pattern entry is either a one-character string that must match the target at the same index, or the empty string, which is a wildcard matching any one lowercase English letter. The lengths must be equal.
Function
matchesWildcardArray(pattern: String[], target: String) → booleanExamples
Example 1
pattern = ["a","","c"]target = "abc"return = trueThe empty middle entry matches b.
Example 2
pattern = ["a","b"]target = "ac"return = falseThe literal b does not match target character c.
Example 3
pattern = []target = ""return = trueTwo empty sequences match.
Constraints
0 <= pattern.length,target.length <= 200000.- Each pattern entry is empty or one lowercase English letter.
targetcontains only lowercase English letters.