Sort it yourself
mediumSorting and searching20 XP
Return nums sorted from small to large, without using a built-in sort. Bubble sort is a good start: keep swapping neighbours that are in the wrong order.
Examples
- Input: nums = [5, 2, 8, 1, 3]Output: [1, 2, 3, 5, 8]
- Input: nums = []Output: []
Examples use JSON: true/false/null are True/False/None in Python.