input: Write a python function to convert a list of strings into a dictionary where the keys are the strings and the values are their corresponding indices.
  assert list_to_dict(["Apple", "Banana", "Cherry"]) == {"Apple": 0, "Banana": 1, "Cherry": 2}
  assert list_to_dict(["Dog", "Cat", "Elephant"]) == {"Dog": 0, "Cat": 1, "Elephant": 2}
  assert list_to_dict(["Python", "Java", "C++"]) == {"Python": 0, "Java": 1, "C++": 2}
output: def list_to_dict(lst):
      return {s: i for i, s in enumerate(lst)}