Search
⌘K

Leetcode 2391. Minimum Amount of Time to Collect Garbage

Three trucks (for M, P, G) start at house 0 and must visit houses in order to pick up one-minute-per-unit garbage with given travel times between consecutive houses, but only one truck can operate at a time. The core task is to compute the minimal total time: sum of all pickup units plus, for each garbage type that appears, the cumulative travel time needed to reach its last house (i.e., find each type's last index and add the prefix travel times).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.