✅✅ Binary Search Approach || Java Solution
\n# Java Code\n\nclass Solution {\n    public int[] successfulPairs(int[] spells, int[] potions, long success) {\n        int pairs[] = new int[spells.length];\
\n# Java Code\n```\nclass Solution {\n    public int[] successfulPairs(int[] spells, int[] potions, long success) {\n        int pairs[] = new int[spells.length];\n\n        Arrays.sort(potions);\n\n        for(int i = 0; i < spells.length; i++)\n        {\n            int start = 0, end = potions.length-1;\n            while(start <= end)\n            {\n                int mid = start + (end - start)/2;\n                if(potions[mid] * (long)spells[i] >= success)\n                {\n                    end = mid - 1;\n                }\n                else\n                {\n                    start = mid + 1;\n                }\n            }\n            pairs[i] = potions.length - start;\n        }\n\n        return pairs;\n    }\n}\n```\n\n# PLEASE UPVOTE \uD83D\uDC4D
['Two Pointers', 'Binary Search', 'Sorting', 'Java']