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.
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.