Problem 1054 · Medium
Always place the most frequent barcode that differs from the last one, using a max heap of counts.
Open the interactive visualisation