#45 - Sort 0's, 1's and 2's array

You are given an array containing only the integers 0, 1, and 2. Your task is to implement a function to sort the array in non-decreasing order.

Example 1

nums = [2, 0, 2, 1, 1, 0]

[0, 0, 1, 1, 2, 2]

Last updated