code: def _get_weights(max_length):
    
    weights = [1]
    for i in range(1, max_length):
      weights.append(weights[i-1] * len(_ALPHABET) + 1)
    weights.reverse()
    return weights
docs: Get weights for each offset in str of certain max length.
  
    Args:
      max_length: max length of the strings.
  
    Returns:
      A list of ints as weights.
  
    Example:
      If max_length is 2 and alphabet is "ab", then we have order "", "a", "aa",
    "ab", "b", "ba", "bb". So the weight for the first char is 3.