You are given an array of strings words and a string target.
A string is considered valid if it is a prefix of at least one string present in words.
Return the minimum number of valid strings required to concatenate and form target. If it is impossible to form target using valid strings, return
Constraints:
words.length
words[i].length
The sum of words[i].length across all elements is at most
words[i] consists only of lowercase English letters.
target.length
target consists only of lowercase English letters.
You are given an array of strings words and a string target.
A string is considered valid if it is a prefix of at least one string present in words.
Return the minimum number of valid strings required to concatenate and form target. If it is impossible to form target using valid strings, return
Constraints:
words.length
words[i].length
The sum of words[i].length across all elements is at most
words[i] consists only of lowercase English letters.
target.length
target consists only of lowercase English letters.