input: Write a function to filter an array based on a given criteria. The criteria is a function that returns True if a given element satisfies a condition, and False otherwise. If the array is empty, return an empty array.
  assert filter_array([], lambda x: x % 5 == 0) == []
  assert filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0) == [5, 10, 15, 20, 25, 30]
  assert filter_array([3, 7, 11, 12, 13], lambda x: x % 2 == 0) == [12]
  assert filter_array([1, 2, 3, 4, 5], lambda x: x > 10) == []
output: def filter_array(arr, criteria):
      return [x for x in arr if criteria(x)]