def chars_to_dictionary(string):
  """ Creates a dictionary char:integer for each unique character
    Args:
        string: a `string` input

    Returns:
        dictionary of chars
    """
  chars = set(string)
  char_idx = {c: i for i, c in enumerate(sorted(chars))}
  return char_idx