public double findMedianSortedArrays(int A[], int B[]) {
            int n = A.length + B.length;
            if (n % 2 == 1) {
                return findKth(A, A.length, B, B.length, n / 2 + 1);
            }
            return (findKth(A, A.length, B, B.length, n / 2) +
                    findKth(A, A.length, B, B.length, n / 2 + 1)) / 2.0;
        }