input: Write a function to find the maximum element in a given array. If the array is empty, return None. If the array contains non-numeric values, raise a ValueError. The function should take a single parameter, which is the array.
  assert find_max([1, 10, 50, 3, 8])==50
  assert find_max([-5, -10, -20, -30])==-5
  assert find_max([1])==1
  assert find_max([])==None
  assert find_max(["a", 1, 2]) # This should raise a ValueError
output: def find_max(arr):
      if not arr:
          return None
      if not all(isinstance(x, (int, float)) for x in arr):
          raise ValueError
      return max(arr)