JAVA || Easy Solution || 99 % Faster Code || Beginner Friendly
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\nPLEASE UPVOTE IF YOU LIKE.\n```\nclass Solution {\n    public int numRescueBoats(int[] people, int limit) {\n        int number = 0;\n        Arrays.sort(people);\n        int l = 0, r = people.length - 1;\n        while( l <= r){\n            if(people[l] + people[r] <= limit)\n                l++;\n            r--;\n            number++;\n        }\n        return number;\n    }\n}\n```
['Java']