NeetCode #207LC-881MediumTwo PointersNC 250
← Back to All Problems#207 · #881 · Boats to Save People(救生艇)
📌 Problem Statement & Constraints
You are given an array
people where people[i] is the weight of the i-th person, and a limit on the total weight each boat can carry. Each boat carries at most two people. Return the minimum number of boats. Constraints: 1 <= people.length <= 5 * 10^4, 1 <= people[i] <= limit <= 3 * 10^4.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!