[Python] Binary Search
\n\n# Code\n\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        def BinarySearch(nums,x
\n\n# Code\n```\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        def BinarySearch(nums,x):\n            l=0\n            r=len(nums)-1\n            while l<=r:\n                m=(l+r)//2\n                if nums[m]>=x:\n                    r=m-1\n                elif nums[m]<x:\n                    l=m+1\n            return r+1\n        ans=[]\n        res=0\n        potions.sort()\n        n=len(potions )\n        for i in range (0,len(spells)):\n            res=0\n            index=BinarySearch(potions,success/spells[i])\n            print(index)\n            if index<=n:\n                res=n-index\n            ans.append(res)\n        return ans\n\n```
['Python3']