If I have two arrays:
a = [ 1, 4, 3, 2]
b = ['z', 'w', 'x', 'y']
and I want to sort both a and b based on the values from a, i.e.:
[ 1, 2, 3, 4] # a
['z','y','x','w'] # b
What is an efficient/idiomatic way to do this?