Simple python solution || Using sort function || two pointer approach
Please upvote if it helps\n\nclass Solution:\n    def numRescueBoats(self, people: List[int], limit: int) -> int:\n        people.sort()\n        count=0\n     
**Please upvote if it helps**\n```\nclass Solution:\n    def numRescueBoats(self, people: List[int], limit: int) -> int:\n        people.sort()\n        count=0\n        i, j =0, len(people)-1\n        while i <= j :\n            if people[j]==limit or people[i]+people[j]>limit:\n                j-=1\n                count+=1\n            else:\n                i+=1\n                j-=1\n                count+=1\n        return count\n```\nTime complexity is O(nlog(n)) and space complexity is O(n).
['Two Pointers', 'Greedy', 'Sorting', 'Python']