leetle

Daily challenge for 2026-11-03

672. Prioritized Shipment Dispatch

You are given a 2D array shipments where each shipment is represented as a 3-element list: [id, priority, deadline].

All shipment id values are unique integers.

Sort and return the list of shipment IDs ordered according to the following dispatch criteria:
1. Higher priority comes first.
2. If priorities are equal, an earlier (smaller) deadline comes first.
3. If both priority and deadline are equal, a smaller id comes first.

Constraints:
There are 0–1,000 shipment rows. Each row has an id, a priority and a deadline, all integers with absolute value at most 1,000,000. Ids are unique. The final id comparison resolves any priority-and-deadline tie.

Example:
Input: shipments = [[101, 2, 5], [102, 3, 8], [103, 3, 4]]
Output: [103, 102, 101]

Run this challenge interactively in Python or JavaScript when the app loads.