public static void merge(int A[], int m, int B[], int n) {
        int index = m + n - 1;
        m--;
        n--;
        while(m >= 0 && n >= 0){
            if(A[m] < B[n]){
                A[index] = B[n];
                n--;
            }else{
                A[index] = A[m];
                m--;
            }
            index--;
        }
        while(n >= 0){
            A[index] = B[n];
            n--;
            index--;
        }
    }