input: Write a function to generate and return all substrings of a given string in order from longest to shortest length.
  
  def substring_in_order(string):
      result = []
      n = len(string)
      for l in range(n, 0, -1):
          for i in range(n-l + 1):
              result.append(string[i:i+l])
      return result
  
  assert substring_in_order("abcd")==['abcd', 'bcd', 'abc', 'cd', 'ab', 'bc', 'a', 'b', 'c', 'd']
  assert substring_in_order("xyz")==['xyz', 'yz', 'xy', 'z', 'x', 'y']
  assert substring_in_order("a")==['a']
  assert substring_in_order("")==[]
output: def substring_in_order(string):
      result = []
      n = len(string)
      for l in range(n, 0, -1):
          for i in range(n-l + 1):
              result.append(string[i:i+l])
      return result