input: Write a function to find the maximum element in a given array. If the array is empty, return None. Use the given array [1, 10, 50, 3, 8] as a test case.
  assert find_max_element([1, 10, 50, 3, 8])==50
  assert find_max_element([])==None
  assert find_max_element([-3, -1, -10, -5])==-1
output: def find_max_element(arr):
      if not arr:
          return None
      max_element = arr[0]
      for num in arr:
          if num > max_element:
              max_element = num
      return max_element