using System.Collections.Generic;
private static List<int> SortColors(List<int> A)
int arrCount = A.Count; int redBall = 0; int whiteBall = 0; int blueBall = 0;
for(var i = 0; i < arrCount; i++){
if(A[i] == 0){ redBall++; }
if(A[i] == 1){ whiteBall++; }
if(A[i] == 2){ blueBall++; }
public static void Main()
List<int> intarr = new List<int>() { 0, 1, 2, 0, 1, 2 };
List<int> SortedArr = Program.SortColors(intarr);
Console.WriteLine("After Sorting: " + string.Join(" ", SortedArr));