arr2 = [(3, 'c'), (2, 'b'), (1, 'a'), (5, 'E')]
output_dict = {}
for key, value in itertools.chain(arr1, arr2):
    output_dict.setdefault(key, []).append(value)
output = [((key,) + tuple(values)) for key, values in list(output_dict.items()) if
    len(values) == 2]
python merging unsorted lists - algorithm analysis