public void sortColors(int[] A) {
        if(A == null || A.length == 0) return;
        int one = 0, two = 0, zero = 0, cur = 0;
        for(int i = 0; i < A.length; i++){
            if(A[i] == 0) zero++;
            else if(A[i] == 1) one++;
            else if(A[i] == 2) two++;
        }
        for(int i = 0; i < zero; i++) A[cur++] = 0;
        for(int i = 0; i < one; i++) A[cur++] = 1;
        for(int i = 0; i < two; i++) A[cur++] = 2;
    }