[JavaScript] 2 Solutions - Binary Search
Time O((n + m) * log(10  ^ 10))\n\nvar kthSmallestProduct = function(nums1, nums2, k) {\n    let rProduct = 10 ** 10, lProduct = -rProduct;\n    const negativeN
**Time O((n + m) * log(10  ^ 10))**\n```\nvar kthSmallestProduct = function(nums1, nums2, k) {\n    let rProduct = 10 ** 10, lProduct = -rProduct;\n    const negativeNums1 = nums1.filter((num) => num < 0);\n    const positiveNums1 = nums1.filter((num) => num >= 0);\n    const negativeNums2 = nums2.filter((num) => num < 0);\n    const positiveNums2 = nums2.filter((num) => num >= 0);\n    const negativeNums1Reverse = [...negativeNums1].reverse();\n    const positiveNums1Reverse = [...positiveNums1].reverse();\n    const negativeNums2Reverse = [...negativeNums2].reverse();\n    const positiveNums2Reverse = [...positiveNums2].reverse();\n\n    const findRank = (list1, list2, product) => {\n        let rank = 0;\n\n        for (let i = list1.length - 1, j = 0; i >= 0; i--) {\n\t\t\tfor (; j < list2.length && list2[j] * list1[i] <= product; j++);\n            rank += j;\n        }\n        \n        return rank;\n    };\n\n    while (lProduct < rProduct) {\n        const midProduct = Math.floor((lProduct + rProduct) / 2);\n\n        if (midProduct >= 0) {\n            var rank = negativeNums1.length * positiveNums2.length +\n                negativeNums2.length * positiveNums1.length +\n                findRank(negativeNums1Reverse, negativeNums2Reverse, midProduct) +\n                findRank(positiveNums1, positiveNums2, midProduct)\n        } else {\n            var rank = findRank(positiveNums1Reverse, negativeNums2, midProduct) +\n                findRank(positiveNums2Reverse, negativeNums1, midProduct);\n        }\n\n        rank < k ? (lProduct = midProduct + 1) : (rProduct = midProduct);\n    }\n    \n    return lProduct;\n};\n```\n\n**Time O(n * log(m) * log(10 ^ 10))**\n```\nvar kthSmallestProduct = function(nums1, nums2, k) {\n    let rProduct = 10 ** 10, lProduct = -rProduct;\n\n    while (lProduct < rProduct) {\n        const midProduct = Math.floor((lProduct + rProduct) / 2);\n        let rank = 0;\n        \n        for (const num1 of nums1) {\n            if (num1 < 0) {\n                let l = 0, r = nums2.length;\n                while (l < r) {\n                    const mid = (l + r) >> 1;\n                    nums2[mid] * num1 <= midProduct ? (r = mid) : (l = mid + 1);\n                }\n\n                rank += nums2.length - l;\n            } else if (num1 > 0) {\n                let l = -1, r = nums2.length - 1;\n                while (l < r) {\n                    const mid = (l + r + 1) >> 1;\n                    nums2[mid] * num1 <= midProduct ? (l = mid) : (r = mid - 1);\n                }\n\n                rank += l + 1;\n            } else {\n                rank += midProduct >= 0 ? nums2.length : 0;\n            }\n        }\n        \n        rank < k ? lProduct = midProduct + 1 : rProduct = midProduct;\n    }\n\n    return lProduct;\n};\n```
[]