FunctionRacerProblemsRace

Sort Each Row

EasyNumPyPython

Return a new 2-D array in which every row of grid has been sorted from smallest to largest. The rows stay in the same order; only the values inside each row move.

Example 1

grid [[3,1,2],[9,8,7]]
returns [[1,2,3],[7,8,9]]

Row 0 becomes [1, 2, 3] and row 1 becomes [7, 8, 9].

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems