input: from typing import List, Callable
  
  def filter_array(array: List[int], criteria: Callable[[int], bool]) -> List[int]:
      """
      Filters an array based on a given criteria and returns the filtered array.
      
      >>> filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0)
      [5, 10, 15, 20, 25, 30]
      >>> filter_array([1, 3, 7, 9, 11], lambda x: x % 2 != 0)
      [1, 3, 7, 9, 11]
      """
output:     return [x for x in array if criteria(x)]