Python short and clean 2-liner. Functional programming.
Approach\n1. Sort potions into, say s_potions.\n\n2. For each spells, say x, binary-search for insertion index i in s_potions.\n\n3. Return len(potions) - i.\n\
# Approach\n1. Sort `potions` into, say `s_potions`.\n\n2. For each `spells`, say `x`, binary-search for insertion index `i` in `s_potions`.\n\n3. Return `len(potions) - i`.\n\n# Complexity\n- Time complexity: $$O((m + n) * log(n))$$\n\n- Space complexity: $$O(m + n)$$\n\nwhere,\n`m is number of spells`,\n`n is number of potions`.\n\n# Code\nWIth currying (partial functions):\n```python\nclass Solution:\n    def successfulPairs(self, spells: list[int], potions: list[int], success: int) -> list[int]:\n        f = partial(bisect.bisect_left, sorted(potions))\n        return (len(potions) - f(success / x) for x in spells)\n\n\n```\nWithout using currying (partial functions):\n```python\nclass Solution:\n    def successfulPairs(self, spells: list[int], potions: list[int], success: int) -> list[int]:\n        s_potions = sorted(potions)\n        return (len(potions) - bisect.bisect_left(s_potions, success / x) for x in spells)\n\n\n```
['Array', 'Binary Search', 'Sorting', 'Python', 'Python3']