input: def generate_substrings(s: str) -> List[str]:
      """ Generate all substrings of given string in order from longest to shortest.
      >>> generate_substrings('abc')
      ['abc', 'ab', 'bc', 'a', 'b', 'c']
      >>> generate_substrings('apple')
      ['apple', 'appl', 'pple', 'app', 'ppl', 'ple', 'ap', 'pp', 'pl', 'le', 'a', 'p', 'p', 'l', 'e']
      """
output:     substrings = []
      n = len(s)
      for length in range(n, 0, -1):
          for start in range(n - length + 1):
              substrings.append(s[start:start+length])
      return substrings