Two Pointers | Sorting | Simple Solution ✅🔥
Please Upvote if you like the solution\uD83D\uDE0A\n\n# Code\n\nclass Solution {\npublic:\n    int numRescueBoats(vector<int>& people, int limit) {\n        sor
# Please Upvote if you like the solution\uD83D\uDE0A\n\n# Code\n```\nclass Solution {\npublic:\n    int numRescueBoats(vector<int>& people, int limit) {\n        sort(people.begin(),people.end());\n        int i = 0, j = people.size()-1, count = 0;\n        while(i<=j){\n            if(people[i] + people[j] <= limit)i++;\n            count++;\n            j--;\n        }\n        return count;\n    }\n};\n```
['C++']