input: Write a function to find the maximum element in a given array. The function should return the maximum element. If the array is empty, the function should return None.
  assert find_max([1, 10, 50, 3, 8])==50
  assert find_max([-1, -10, -50, -3, -8])==-1
  assert find_max([3])==3
  assert find_max([7, 22, 9, 11, 5])==22
  assert find_max([])==None
output: def find_max(arr):
      if not arr:
          return None
      return max(arr)