Question: JAVASCRIPT OR PYTHON Given: An array of size N, comprising the numbers zeroes, ones, and twos. Task: Create a function to Sort the array in
JAVASCRIPT OR PYTHON
Given: An array of size N, comprising the numbers zeroes, ones, and twos.
Task: Create a function to Sort the array in ascending order.
Input 1: [1,1,0,2,2,2,0,2,1,0,2,0]
Input 2: [2,1,0,2,1,0,2,1,0]
Expected Output 1: [0,0,0,0,1,1,1,2,2,2,2,2]
Expected Output 2: [0,0,0,1,1,1,2,2,2]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
