Python solution using two pointer approach.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution(object):\n    def numRescueBoats(self, people, limit):\n        """\n        :type people: List[int]\n        :type limit: int\n        :rtype: int\n        """\n        boats = 0\n        people.sort()  # Sort the array in ascending order\n        left, right = 0, len(people) - 1\n        \n        while left <= right:\n            if left == right:\n                # If there\'s only one person left\n                boats += 1\n                break\n            \n            if people[left] + people[right] <= limit:\n                # If the sum of weights of two people can fit in one boat\n                left += 1\n                right -= 1\n            else:\n                # If only one person can fit in one boat\n                right -= 1\n            boats += 1\n        \n        return boats\n\n```
['Python']