input: Write a function to filter an array by a given criteria and return the filtered array. If the given array is empty then return an empty array. The criteria is a function that takes a single argument and returns a boolean.
  assert filter_array(lambda x: x % 5 == 0, [1, 2, 5, 10, 15, 20, 25, 30])==[5, 10, 15, 20, 25, 30]
  assert filter_array(lambda x: x > 10, [1, 2, 5, 10, 15, 20, 25, 30])==[15, 20, 25, 30]
  assert filter_array(lambda x: x % 2 == 0, [1, 2, 5, 10, 15, 20, 25, 30])==[2, 10, 20, 30]
  assert filter_array(lambda x: x % 3 == 0, [1, 2, 5, 10, 15, 20, 25, 30])==[15, 30]
  assert filter_array(lambda x: x > 50, [1, 2, 5, 10, 15, 20, 25, 30])==[]
  assert filter_array(lambda x: x < 0, [])==[]
output: def filter_array(criteria, arr):
      return [x for x in arr if criteria(x)]