Skip to content

parking

bradendubois edited this page Nov 24, 2021 · 9 revisions

Parking

ID: parking

Difficulty: 2.1

CPU Time: 1 second

Memory: 1024 MB

Solution

For this problem, one can simply mark every moment each car is present in a map of some sort, and then iterate from the moment the first car arrives to when the last car leaves, and increment a total of the cost per car (at that moment) multiplied by the number of cars present.

Clone this wiki locally