Daily Challenge 03 April [C++]
Approach\nTwo Pointers Approach\n\n# Complexity\n- Time complexity: O(nlogn)\n\n- Space complexity: O(1)\n# Code\n\nclass Solution {\npublic:\n    int numRescue
# Approach\nTwo Pointers Approach\n\n# Complexity\n- Time complexity: **O(nlogn)**\n\n- Space complexity: **O(1)**\n# Code\n```\nclass Solution {\npublic:\n    int numRescueBoats(vector<int>& p, int limit) {\n        int boat = 0;\n        sort(p.begin(), p.end());\n        int s = 0, e = p.size()-1;\n        while(s <= e){\n            boat++;\n            if(p[s] + p[e] == limit){\n                s++;\n            }\n            else if(p[s] + p[e] < limit){\n                s++; \n            }\n            e--;\n        }\n        return boat;\n    }\n};\n```
['C++']