A valid encoding of an array of strings words consists of a reference string s and an array of indices indices satisfying the following conditions:
words.length is equal to indices.length.
For each index i, the substring of s starting at indices[i] and extending up to the next '#' character is equal to words[i].
Given an array of strings words, return the minimum possible length of any reference string s that validly encodes words.
Constraints:
words.length
words[i].length
words[i] consists of only lowercase letters.
A valid encoding of an array of strings words consists of a reference string s and an array of indices indices satisfying the following conditions:
words.length is equal to indices.length.
For each index i, the substring of s starting at indices[i] and extending up to the next '#' character is equal to words[i].
Given an array of strings words, return the minimum possible length of any reference string s that validly encodes words.
Constraints:
words.length
words[i].length
words[i] consists of only lowercase letters.