Sort an Array — Sorting & Divide-and-Conquer

Arrange all scores, duplicates included, from lowest to highest.

Sorting & Divide-and-Conquer · Easy

The problem

A leaderboard needs its scores in order from lowest to highest. Given a list of integers, return the same values arranged from smallest to largest.

The story

A leaderboard of scores needs its scores in order. Return every score, repeats included, sorted from smallest to largest.

What to return

Constraints

Example

Input
nums = [7, 2, 9, 4]
Output
[2, 4, 7, 9]

Solve it

More in Sorting & Divide-and-Conquer

All algorithm problems