Problem 1054 · Medium

Distant Barcodes

Always place the most frequent barcode that differs from the last one, using a max heap of counts.

Open the interactive visualisation