A set of words is encoded by one string s that ends with # after each word's position: every word w must appear in s starting at some index i and ending just before a #. So "time#bell#" encodes ["time", "bell"], and "time#" encodes both "time" and "me" (since "me" ends right before the # as well). Return the length of the shortest such string s.
For ["time", "me", "bell"] the answer is 10 ("time#bell#").
Example 1
Input:
minimum_length_encoding(['time', 'me', 'bell'])
Output:
10
Example 2
Input:
minimum_length_encoding(['t'])
Output:
2
0 <= len(words) <= 200001 <= len(word) <= 7, lower-case letters.No results yet
Run your code to check it against the examples, or submit to run every test.