1

I'd like to sort b base on a's value descending order;

a = [2,1,5,3,4]

b = [(0,0),(1,1),(2,2),(3,3),(4,4)]

For loop is working, but is there some way more faster?

result would be:

b: [(2,2),(4,4),(3,3),(0,0),(1,1)]
Stephen Rauch
  • 44,696
  • 30
  • 102
  • 125

0 Answers0