Binary Search
\nIf ith potion is successful then all the potions after will be successful.\n    So find the first potion which is successful using Binary Search.\n\nclass Sol
\n***If ith potion is successful then all the potions after will be successful.\n    So find the first potion which is successful using Binary Search.***\n```\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {\n        \n        vector<int> res;\n        int n(size(potions));\n        sort(begin(potions), end(potions));\n        \n        for (auto& spell : spells) {\n            int start(0), end(n);\n            while (start < end) {\n                int mid = start + (end-start)/2;\n                ((long long)spell*potions[mid] >= success) ? end = mid : start = mid+1;\n            }\n            res.push_back(n-start);\n        }\n        return res;\n    }\n};\n```
['C', 'Binary Tree']