Please solve the programming task below using a self-contained code snippet in a markdown code block.

A valid encoding of an array of words is any reference string s and array of indices indices such that:

words.length == indices.length
The reference string s ends with the '#' character.
For each index indices[i], the substring of s starting from indices[i] and up to (but not including) the next '#' character is equal to words[i].

Given an array of words, return the length of the shortest reference string s possible of any valid encoding of words.
 
Please complete the following python code precisely:
```python
class Solution:
    def minimumLengthEncoding(self, words: List[str]) -> int:
```