Search
⌘K

Leetcode 3576. Transform Array to All Equal Elements

Given an array of ±1, you may flip the signs of any adjacent pair (multiply two consecutive elements by -1) up to k times; decide whether you can make all elements equal. The core challenge is computing the minimal number of adjacent-pair toggles required (efficiently for n up to 1e5) and checking if it is ≤ k.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.