Search
⌘K

Leetcode 1503. Last Moment Before All Ants Fall Out of a Plank

Given a plank of length n and arrays of ant positions moving left or right, compute when the last ant falls off. Key insight: collisions simply swap identities, so treat ants as passing through and return the maximum time any ant needs to reach an edge (distance to nearest end in its moving direction).


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.