public int[] countingSort(int[] a,int k){
        int[] c = new int[k];
        int[] b = new int[a.length];
        for (int i = 0; i < k; i++)
        {
            c[i]=0;
        }
        for (int i = 0; i < a.length; i++)
        {
            c[i]=c[a[i]]+1;
        }
        for (int i = 1; i < k; i++)
        {
            c[i]=c[i]+c[i-1];
        }
        for (int j = 0; j < a.length; j++)
        {
            b[c[a[j]]] = a[j];
            c[a[j]]=c[a[j]]-1;
        }
        return b;
    }