input: from typing import List
  
  def find_max_element(arr: List[int]) -> int:
      """
      Find the maximum element in the given array.
      >>> find_max_element([1, 10, 50, 3, 8])
      50
      >>> find_max_element([-1, -5, -3, -2, -4])
      -1
      """
output:     if not arr:
          return None
      max_element = arr[0]
      for num in arr:
          if num > max_element:
              max_element = num
      return max_element