Binary Search
\npublic int[] successfulPairs(int[] spells, int[] potions, long success) {\n        Arrays.sort(potions);\n        for(int i=0;i<spells.length;i++){\n         
```\npublic int[] successfulPairs(int[] spells, int[] potions, long success) {\n        Arrays.sort(potions);\n        for(int i=0;i<spells.length;i++){\n            int l=0,h=potions.length;\n            while(l<h){\n                int mid = (l+h)/2;\n                if(1L*spells[i]*potions[mid]>=success){\n                    h=mid;\n                }else{\n                    l=mid+1;\n                }\n            }\n            spells[i]=potions.length-l;\n        }\n        return spells;\n    }\n```
['Java']