input: Write a python function to find the maximum difference between two elements in an array such that the larger element appears after the smaller element.
  assert maxDifference([3, 8, 9, 6, 4, 10])==7
  assert maxDifference([1, 2, 90, 10, 110])==109
  assert maxDifference([10, 9, 8, 7, 6])==0
output: def maxDifference(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)
          else:
              min_element = arr[i]
      
      return max_diff