@@ -0,0 +1,1422 @@
+package leetcode;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * https://leetcode.com/problems/sort-colors/%0A */%0Apublic class Problem75 %7B%0A    public void sortColors(int%5B%5D nums) %7B%0A        // using counting sort%0A        int%5B%5D aux = new int%5Bnums.length%5D;%0A        for (int i = 0; i %3C aux.length; i++) %7B%0A            aux%5Bi%5D = nums%5Bi%5D;%0A        %7D%0A        System.out.println(%22Input: %22 + Arrays.toString(nums));%0A        int size = 3;%0A        int%5B%5D count = new int%5Bsize%5D;%0A        for (int i = 0; i %3C aux.length; i++) %7B%0A            count%5Baux%5Bi%5D%5D += 1;%0A        %7D%0A        System.out.println(%22Count: %22 + Arrays.toString(count));%0A        for (int i = 1; i %3C count.length; i++) %7B%0A            count%5Bi%5D = count%5Bi-1%5D + count%5Bi%5D;%0A        %7D%0A        System.out.println(%22Sum: %22 + Arrays.toString(count));%0A        for (int i = aux.length-1; i %3E= 0; i--) %7B%0A            int val = aux%5Bi%5D;%0A            count%5Bval%5D--;%0A            int idx = count%5Bval%5D;%0A            nums%5Bidx%5D = val;%0A        %7D%0A        System.out.println(%22Sorted: %22 + Arrays.toString(nums));%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        Problem75 prob = new Problem75();%0A//        prob.sortColors(new int%5B%5D%7B2%7D);%0A//        prob.sortColors(new int%5B%5D%7B3, 2, 1, 2, 3, 1%7D);%0A//        prob.sortColors(new int%5B%5D%7B2, 27, 22, 8, 28, 1, 30, 8, 29, 28, 15, 16, 25, 28, 23, 16, 24, 23, 17, 11, 4, 2, 2, 22, 23, 8, 29, 16, 29, 28%7D);%0A//        prob.sortColors(new int%5B%5D%7B1, 4, 1, 2, 7, 5, 2%7D);%0A    %7D%0A%7D%0A

Solve problem 75