Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1687. Delivering Boxes from Storage to Ports
Given an ordered list of boxes (port, weight) and ship limits on maxBoxes and maxWeight, partition the sequence into contiguous delivery batches (respecting capacity) to minimize total trips, where each batch’s cost depends on the number of port switches inside it plus return trips. The core challenge is an optimization over contiguous segments — typically solved with dynamic programming combined with prefix sums and a sliding-window/monotonic-queue optimization to account for port-change costs efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.