public double findMedianSortedArrays(int[] A, int[] B) {
        // write your code here
        int len = A.length + B.length;
        if (len % 2 == 0) {
            // even number
            return (findKth(A, B, 0, 0, len / 2) + findKth(A, B, 0, 0, len / 2 + 1)) / 2.0;
        } else {
            return findKth(A, B, 0, 0, len / 2 + 1);
        }
    }