You are given two strings, s and sub, along with a 2D character array mappings, where mappings[i] = [old_i, new_i] indicates that any occurrence of the character old_i in sub can be replaced with new_i. Each character in sub may be replaced at most once, and characters in s cannot be replaced.
Return true if it is possible to make sub a substring of s after replacing zero or more characters in sub using the given mappings. Otherwise, return false.
Note: A substring is a contiguous non empty sequence of characters within a string.
Constraints:
sub.length s.length
mappings.length
mappings[i].length
old_i ≠ new_i
s and sub consist of uppercase and lowercase English letters and digits.
old_i and new_i are either uppercase or lowercase English letters or digits.
You are given two strings, s and sub, along with a 2D character array mappings, where mappings[i] = [old_i, new_i] indicates that any occurrence of the character old_i in sub can be replaced with new_i. Each character in sub may be replaced at most once, and characters in s cannot be replaced.
Return true if it is possible to make sub a substring of s after replacing zero or more characters in sub using the given mappings. Otherwise, return false.
Note: A substring is a contiguous non empty sequence of characters within a string.
Constraints:
sub.length s.length
mappings.length
mappings[i].length
old_i ≠ new_i
s and sub consist of uppercase and lowercase English letters and digits.
old_i and new_i are either uppercase or lowercase English letters or digits.