Python - Binary Search - Clean Code
\nclass Solution:\n    def kthSmallestProduct(self, nums1: List[int], nums2: List[int], k: int) -> int:\n        n = len(nums1)\n        m = len(nums2)\n       
```\nclass Solution:\n    def kthSmallestProduct(self, nums1: List[int], nums2: List[int], k: int) -> int:\n        n = len(nums1)\n        m = len(nums2)\n        \n        nPos = [num for num in nums1 if num >= 0]\n        nNeg = [-num for num in nums1 if num < 0][::-1]\n        mPos = [num for num in nums2 if num >= 0]\n        mNeg = [-num for num in nums2 if num < 0][::-1]\n        \n        numOfNegatives = len(nPos) * len(mNeg) + len(mPos) * len(nNeg)\n        sign = 1\n        if k > numOfNegatives:\n            k -= numOfNegatives\n        else:\n            k = numOfNegatives - k + 1\n            temp = mPos\n            mPos = mNeg\n            mNeg = temp\n            sign = -1\n        \n        \n        def count(n, m, target):\n            result = 0\n            right = len(m) - 1\n            \n            for left in range(len(n)):\n                while right >= 0 and n[left] * m[right] > target:\n                    right -= 1\n                result += right + 1\n            return result\n        \n        \n        left = 0\n        right = 10**10\n        \n        while left < right:\n            mid = left + (right - left) // 2\n            \n            countPos = count(nPos, mPos, mid) + count(nNeg, mNeg, mid)\n            \n            if countPos >= k:\n                right = mid\n            else:\n                left = mid + 1\n        \n        return left * sign\n```
[]