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