Problem 3576 · Medium

Transform Array to All Equal Elements

An array holds only 1 and -1. One move negates two neighbouring entries; decide whether at most k moves can make every entry the same.

Open the interactive visualisation