[ Python ] | Simple & Clean Solution using Binary Search
Code\n\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        ans = []\n        potions.sor
# Code\n```\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        ans = []\n        potions.sort()\n\n        n = len(potions)\n        for s in spells:\n            ind = bisect_left(potions, success / s)\n            ans.append(n - ind)\n        return ans\n```\n\n## Binary Search\n```\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        ans = []\n        potions.sort()\n\n        n = len(potions)\n        for s in spells:\n            l, r = 0, n - 1\n            while l <= r:\n                mid = (l + r) >> 1\n                if potions[mid] * s >= success:\n                    r = mid - 1\n                else:\n                    l = mid + 1\n            ans.append(n - l)\n        return ans\n```
['Array', 'Two Pointers', 'Binary Search', 'Sorting', 'Python3']