Daily challenge for 2026-11-18
687. Unique Package Origin Tracker
A fulfillment warehouse labels every outgoing box with a tracking string of the form "ORIGIN:DESTINATION" (for example, "JFK:LHR").
Given an array of shipment records shipments and a target destination targetDest, determine the count of unique origin hubs that have directly dispatched at least one package to targetDest.
Assumptions and Bounds:
- 0 <= len(shipments) <= 100
- Each element in shipments contains exactly one colon ':' separating non-empty origin and destination codes.
- Hub codes consist solely of uppercase English letters.
- targetDest is a non-empty string consisting solely of uppercase English letters.
Example:Input: {"shipments": ["ORD:BOS", "JFK:BOS", "ORD:BOS", "MIA:SFO"], "targetDest": "BOS"}Output: 2