Search
⌘K

Leetcode 2460. Apply Operations to an Array

Sequentially scan the array and whenever adjacent elements are equal, double the left one and set the right one to zero (operations applied in order, not simultaneously). After all operations, stably move all zeros to the end and return the resulting array.


Question Timeline

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

Comments

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