Search
⌘K

Leetcode 335. Self Crossing

Given a sequence of step lengths taken in repeating north, west, south, east directions (counterclockwise), determine whether the resulting axis-aligned polyline ever intersects itself. The challenge is to detect any geometric self-crossing efficiently for arrays up to 1e5 elements.


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.