Daily challenge for 2026-08-13
590. Cargo Container Route Audit
You are auditing a shipping logistics database. You are given two arrays of equal length: ids (representing container IDs) and locations (representing the destination ports where those containers were scanned).
Find the first container ID (by its earliest appearance in the ids array) that has been sent to more than one unique location. If no container has been sent to multiple unique locations, return -1.
Example:Input: ids = [1, 2, 1, 3], locations = ["A", "B", "B", "C"]Output: 1
Explanation: Container 1 is sent to "A" and "B" (2 unique locations). Container 2 is only sent to "B". Container 3 is only sent to "C". Thus, 1 is the first container with multiple unique destinations.
Run this challenge interactively in Python or JavaScript when the app loads.