I have two lists ns
and ts
. I would like to sort ns
and then, based on the way it was sorted, move around ts
so that it matches ns
accordingly. Something like this would be the input and output:
ns = (0 4 2 5 1)
ts = (1 2 3 4 5)
ns = (0 1 2 4 5)
ts = (1 5 3 2 4)
I know that I can sort each of these via ns.sort()
and ts.sort()
, but this will only help to sort ns
.