You are given an array of strings words and an integer k.
For each index i from words.length words[i]. Find the maximum length of a common prefix shared by any k strings chosen from this remaining list. If it is impossible to choose k strings that share a common prefix of positive length, the maximum length is
Return an integer array ans of size words.length, where ans[i] is the maximum common prefix length among any k strings after removing words[i].
Constraints:
k words.length
words[i].length
words[i] consists of lowercase English letters.
The sum of words[i].length is smaller than or equal to
You are given an array of strings words and an integer k.
For each index i from words.length words[i]. Find the maximum length of a common prefix shared by any k strings chosen from this remaining list. If it is impossible to choose k strings that share a common prefix of positive length, the maximum length is
Return an integer array ans of size words.length, where ans[i] is the maximum common prefix length among any k strings after removing words[i].
Constraints:
k words.length
words[i].length
words[i] consists of lowercase English letters.
The sum of words[i].length is smaller than or equal to