Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Maximum Candies You Can Get from Boxes
Coding · Array · Breadth-First Search · Graph Theory
- Accepted Candidates From the Interviews
Coding
- Alien Dictionary (hard problem from leetcode)
Coding
- All Paths from Source Lead to Destination
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1687. Delivering Boxes from Storage to Ports
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source