input: Write a function to find the maximum element in a given array. The function should take an array as input and return the maximum element in that array. If the given array is empty, the function should return None.
  assert find_max([1, 10, 50, 3, 8])==50
  assert find_max([-1, -2, -3, -4])==-1
  assert find_max([9])==9
  assert find_max([])==None
output: def find_max(arr):
      if not arr:
          return None
      return max(arr)