2300. Successful Pairs of Spells and Potions

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2300

class Solution:
    def successfulPairs(
        self, spells: List[int], potions: List[int], success: int
    ) -> List[int]:
        potions.sort()
        m = len(potions)
        return [m - bisect_left(potions, success / v) for v in spells]