new_in, new_out = [], []
for i, inp in enumerate(inputs):
found_duplicate = False
for j in range(i + 1, len(inputs)):
if inp == inputs[j]:
found_duplicate = True
if outputs[i] > outputs[j]:
outputs[j] = outputs[i]
After Change
data[tup] = [out]
inputs, outputs = [], []
for inp, outs in data.items():
inputs.append(list(inp))
outputs.append(np.maximum.reduce(outs))
return inputs, outputs