Build a dictionary.
Implement build_dictionary(pairs) to convert a list of two-element key-value pairs into a dictionary. If a key appears more than once, the last value must be retained. The input is a list of pairs and the output is a dictionary; preserve the order in which keys are first inserted.
def build_dictionary(pairs):