Search
⌘K

Leetcode 3028. Ant on the Boundary

An ant starts at position 0 and takes successive signed steps from nums (positive = right, negative = left). Count how many times its cumulative position is exactly 0 after completing a step (crossing the boundary mid-step does not count).


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.