[Python] NumPy
It\'s kind of rare to see a use case for np.searchsorted but it makes the code fairly concise.\n\npython\nimport numpy as np\n\nclass Solution:\n    def kthSmal
It\'s kind of rare to see a use case for np.searchsorted but it makes the code fairly concise.\n\n```python\nimport numpy as np\n\nclass Solution:\n    def kthSmallestProduct(self, nums1: List[int], nums2: List[int], k: int) -> int:\n        A = np.sort(nums1)\n        B = np.sort(nums2)\n        Aneg, Azero, Apos = A[A < 0], A[A == 0], A[A > 0]\n\n        def f(x):\n            # Count number of a * b <= x, casing on the sign of a\n            countZero = len(Azero) * len(B) if x >= 0 else 0\n            countPos = np.searchsorted(B, x // Apos, side="right").sum()\n            countNeg = len(Aneg) * len(B) - np.searchsorted(B, (-x - 1) // (-Aneg), side="right").sum()\n            return countNeg + countZero + countPos\n\n        lo = -(10 ** 10)\n        hi = 10 ** 10\n        while lo < hi:\n            mid = (lo + hi) // 2\n            if f(mid) >= k:\n                hi = mid\n            else:\n                lo = mid + 1\n        return hi\n```\n\nProblem https://atcoder.jp/contests/abc155/tasks/abc155_d is similar.
[]