input: Write a python function to filter a dictionary based on a list of criteria.
  assert filter_by_criteria({"a": 1, "b": 2, "c": 3, "d": 4}, ["a", "b"]) == {"a": 1, "b": 2}
  assert filter_by_criteria({"x": 5, "y": 6, "z": 7}, ["x", "z"]) == {"x": 5, "z": 7}
  assert filter_by_criteria({"p": 9, "q": 8, "r": 7}, ["p", "r"]) == {"p": 9, "r": 7}
output: def filter_by_criteria(input_dict, criteria):
      return {key: input_dict[key] for key in criteria if key in input_dict}