input: Write a python function to optimize a system configuration by minimizing energy.
  assert optimize_system([{'config': 1, 'energy': 100}, {'config': 2, 'energy': 200}, {'config': 3, 'energy': 50}]) == {'config': 3, 'energy': 50}
  assert optimize_system([{'config': 'A', 'energy': 30}, {'config': 'B', 'energy': 10}, {'config': 'C', 'energy': 20}]) == {'config': 'B', 'energy': 10}
  assert optimize_system([{'config': 'X', 'energy': 500}, {'config': 'Y', 'energy': 300}, {'config': 'Z', 'energy': 400}]) == {'config': 'Y', 'energy': 300}
output: def optimize_system(configurations):
      return min(configurations, key=lambda x: x['energy'])