Is Regex Matching
The developers at Amazon are developing a regex matching library for their NLP use cases. A prototype regex matching has the following requirements:
For example,
Given an array, arr, of length k containing strings consisting of lowercase English letters only and a string regex of length n, for each of them find whether the given regex matches with the string or not and report an array of strings "YES" or "NO" respectively.
Complete the function isRegexMatching in the editor.
isRegexMatching has the following parameters:
- regex: A regex
- arr[k]: An array of strings
Returns
string[]: An array of strings of size k where the ith string is "YES" if the ith string in arr matches with regex, otherwise it is "NO".
🌷༊·°Credit to Alex𓂃🖊