input: Write a python function to optimize an array such that each element is greater than or equal to the previous element in the new array.
  assert optimize_array([7, 2, 5, 8, 4, 0]) == [7, 5, 8]
  assert optimize_array([1, 3, 2, 4, 3, 5]) == [1, 3, 4, 5]
  assert optimize_array([9, 7, 6, 10, 11, 5]) == [9, 10, 11]
output: def optimize_array(arr):
      if not arr:
          return []
  
      optimized = [arr[0]]
      for num in arr[1:]:
          if num >= optimized[-1]:
              optimized.append(num)
  
      return optimized