public static Integer[] mergeBintoA(Integer[] A, Integer[] B){
		//1 3 7 _ _ _
		//2 4 5
		//1 2 3 4 5 7

		//- - - 1 3 7
		//1 - - - 3 7
		//1 2

		//Let us assume the array is init with min value for missing spaces
		int aLength = A.length;

		//First we determine where the last element is 
		int lastElementPos = 0;
		for(int i =0; i<aLength; i++){
			if(A[i] == Integer.MIN_VALUE){
				lastElementPos = i-1;
				break;
			}
		}

		//Then we shift the array to the end
		int count = 0;
		for(int i = lastElementPos; i>=0; i--){
			A[aLength-1 - count] = A[i];
			A[i] = Integer.MIN_VALUE;
			count++;
		}

		//printList("Shifted:", A);


		//Now we can merge
		int aStart = 0;
		for(int i=0; i<aLength; i++){
			if(A[i] != Integer.MIN_VALUE){
				aStart = i;
				break;
			}
		}

		int bStart = 0, aHead = 0;
		while(bStart != (B.length) ){
			if(A[aStart] < B[bStart]){
				A[aHead] = A[aStart];
				A[aStart] = Integer.MIN_VALUE;
				aHead++;
				aStart++;
			}
			else{
				A[aHead] = B[bStart];
				aHead++;
				bStart++;
			}
		}

		return A;
	}