You are given two string arrays, startWords and targetWords. For each string in targetWords, you want to determine whether it can be formed by taking a string from startWords, appending exactly one lowercase English letter that was not originally present in that string, and rearranging its characters into any permutation.
Return the total number of strings in targetWords that can be obtained from at least one string in startWords.
Note: Each string in
startWordscan be used multiple times to obtain different strings intargetWords.
Constraints:
startWords.length, targetWords.length
startWords[i].length, targetWords[j].length
Each string of startWords and targetWords consists of lowercase English letters only.
No letter occurs more than once in any string of startWords or targetWords.
You are given two string arrays, startWords and targetWords. For each string in targetWords, you want to determine whether it can be formed by taking a string from startWords, appending exactly one lowercase English letter that was not originally present in that string, and rearranging its characters into any permutation.
Return the total number of strings in targetWords that can be obtained from at least one string in startWords.
Note: Each string in
startWordscan be used multiple times to obtain different strings intargetWords.
Constraints:
startWords.length, targetWords.length
startWords[i].length, targetWords[j].length
Each string of startWords and targetWords consists of lowercase English letters only.
No letter occurs more than once in any string of startWords or targetWords.