Premium problem109. Sort Rows by a Given Column

Easy Locked

Return the rows of 2-D array X, reordered so column col is in ascending order.

Input

X =
[[3 0]
 [1 0]
 [2 0]]
col = 0

Output

[[1 0]
 [2 0]
 [3 0]]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)