You are given a string array words of length n and a binary integer array groups of the same length n.
A subsequence of words of length groups[] != groups[] for all
Return an array of strings representing the longest valid subsequence of words. If there are multiple valid subsequences of the maximum length, return any of them.
Note: A subsequence is a sequence that can be derived from another sequence by deleting zero or more elements without changing the order of the remaining elements.
Constraints:
words.length groups.length
words[i].length
groups[i] is either
words consists of distinct strings
words[i] consists of lowercase English letters
You are given a string array words of length n and a binary integer array groups of the same length n.
A subsequence of words of length groups[] != groups[] for all
Return an array of strings representing the longest valid subsequence of words. If there are multiple valid subsequences of the maximum length, return any of them.
Note: A subsequence is a sequence that can be derived from another sequence by deleting zero or more elements without changing the order of the remaining elements.
Constraints:
words.length groups.length
words[i].length
groups[i] is either
words consists of distinct strings
words[i] consists of lowercase English letters