[Java] Easy solution using Binary search || O(n*logn)
O(n*log(n)) / O(1)\n\n    public int[] successfulPairs(int[] spells, int[] potions, long success) {\n        Arrays.sort(potions);\n        \n        for(int i 
**O(n*log(n)) / O(1)**\n```\n    public int[] successfulPairs(int[] spells, int[] potions, long success) {\n        Arrays.sort(potions);\n        \n        for(int i = 0; i < spells.length; i++) {\n            int l = 0, r = potions.length;\n            \n            while(l < r) {\n                int m = l + (r - l) / 2;\n                \n                if((long)spells[i]*potions[m]  >= success)\n                    r = m;\n                else\n                    l = m + 1;\n            }\n            \n            spells[i] = potions.length - l;\n        }\n        \n        return spells;\n    }\n```\n*Comment down, If you have any doubt.*\n**Upvote^, If you liked it.**
['Binary Tree', 'Java']