884. Uncommon Words from Two Sentences
A sentence is a string of single-space separated words where each word consists only of lowercase letters.
A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence.
Given two sentences
s1
ands2
, return a list of all the uncommon words. You may return the answer in any order.
3292. Minimum Number of Valid Strings to Form Target II
You are given an array of strings
words
and a stringtarget
.A string
x
is called valid ifx
is a prefix of any string inwords
.Return the minimum number of valid strings that can be concatenated to form
target
. If it is not possible to formtarget
, return-1
.A prefix of a string is a substring that starts from the beginning of the string and extends to any point within it.
3291. Minimum Number of Valid Strings to Form Target I
You are given an array of strings
words
and a stringtarget
.A string
x
is called valid ifx
is a prefix of any string inwords
.Return the minimum number of valid strings that can be concatenated to form
target
. If it is not possible to formtarget
, return-1
.A prefix of a string is a substring that starts from the beginning of the string and extends to any point within it.