input: Write a python function to find the maximum difference between any two elements in a list where the larger element comes after the smaller element.
  assert solve([2, 3, 10, 6, 4, 8, 1]) == 8
  assert solve([7, 9, 5, 6, 3, 2]) == 2
  assert solve([10, 20, 30, 40, 50]) == 40
output: def solve(lst):
      if not lst or len(lst) < 2:
          return 0
      min_element = lst[0]
      max_diff = 0
      
      for i in range(1, len(lst)):
          if lst[i] - min_element > max_diff:
              max_diff = lst[i] - min_element
          if lst[i] < min_element:
              min_element = lst[i]
      
      return max_diff