input: Write a function to convert an array into a dictionary where elements at even indices become keys and elements at odd indices become values.
  assert array_to_dict(['a', 1, 'b', 2, 'c', 3]) == {'a': 1, 'b': 2, 'c': 3}
  assert array_to_dict([1, 'one', 2, 'two', 3, 'three']) == {1: 'one', 2: 'two', 3: 'three'}
  assert array_to_dict(['x', 24, 'y', 25, 'z', 26]) == {'x': 24, 'y': 25, 'z': 26}
output: def array_to_dict(arr):
      return {arr[i]: arr[i + 1] for i in range(0, len(arr), 2)}