Powerful Binary search Approach
\n# Time Complexity----->O(NLogN)\n\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        
\n# Time Complexity----->O(NLogN)\n```\nclass Solution:\n    def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:\n        list1=[]\n        potions.sort()\n        // some test cases are not sorted\n        for s in spells:\n            // binary search on left most value i.e greater than success\n            left,right,index=0,len(potions)-1,len(potions)# index is len(potions) in worst case where no values matches with potions values\n            while left<=right:\n                mid=(left+right)//2\n                if s*potions[mid]>=success:\n                    right=mid-1\n                    index=mid\n                else:\n                    left=mid+1\n            // add all possible values by total length -index\n            list1.append(len(potions)-index)\n        return list1\n        \n```\n# please upvote me it would encourage me alot\n\n
['Python3']