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 max_difference([2, 9, 4, 1, 5]) == 7
  assert max_difference([1, 2, 90, 10, 110]) == 109
  assert max_difference([7, 9, 5, 6, 3, 2]) == 2
output: def max_difference(arr):
      if not arr or len(arr) < 2:
          return 0
      
      min_element = arr[0]
      max_diff = 0
      
      for i in range(1, len(arr)):
          if arr[i] > min_element:
              max_diff = max(max_diff, arr[i] - min_element)
          min_element = min(min_element, arr[i])
      
      return max_diff