2026/10/13 15:03:48
元宝 LeetCode 335. Self Crossing Java Implement
Core idea: O(n) scan with three local cases. Simulating the whole path is
“O(n)”; the key insight is that segment
“i” can only ever intersect segment
“i-3”,
“i-4”, or
“i-5” — everything older is walled off. So one pass with a sliding window of t…