Sort array elements without using For Loop


I use For Loops in my dynamo projects a lot. and they make the program run time too long.
in the picture, I try to sort a 7*2 array based on the Z coordinate of points. the result is exactly what I want.
but is there any way to avoid for loops in this case?
because of array size affects the run time very much .in my original program it takes 15 minutes to complete!

forLoopAlternate.dyn (2.4 KB)


Have you tried List.SortBykey?