a = [3,1,2]b = ["apple", "banana", "cherries"]a, b = a.zip(b).sort.transposep ap b
Standard input is empty
[1, 2, 3] ["banana", "cherries", "apple"]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!