fork(1) download
  1. A = [239, 1678, 2678, 4430, 199]
  2. B = [4126.77552299, 984.39685939, 237.92397237, 497.72447701, 3377.17916825]
  3.  
  4. order = [i for _, i in sorted(zip(A, range(len(A))))]
  5. B = [b for _, b in sorted(zip(order, sorted(B)))]
  6. print(order, B)
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
[4, 0, 1, 2, 3] [497.72447701, 984.39685939, 3377.17916825, 4126.77552299, 237.92397237]