Zeros, Ones and Twos


An array is given containing only 0s, 1s, and 2s. Sort the array in ascending order.

Write a function solve that have the following parameter(s):
1.) arr = array of integers

Example
Input:
arr = [2, 1, 0, 1]
Output:
The function will return,
[0, 1, 1, 2]

Input:
arr = [1, 0, 2, 1, 0, 2]
Output: [0, 0, 1, 1, 2, 2]

Explanation
After sorting an array in ascending order. 0s, 1s, and 2s are arranged.
Constraints
• The number of elements in the array will be greater than or equal to 1 and less than or equal to 1000.
• Each element of the array will be greater than or equal to 0 and less than or equal to 2.