Problem 4038 · Medium

Count Integers Appearing in a Single Block

Mark each place where a value starts a new run; values that start exactly one run are the ones whose copies sit together.

Open the interactive visualisation