Leetcode 3459. Length of Longest V-Shaped Diagonal Segment
Find the maximum length of a diagonal path in an n×m grid of {0,1,2} that starts at a 1 and then follows the alternating sequence 2,0,2,0,... along diagonal moves (any of the four diagonal directions), with at most one clockwise 90° turn to another diagonal while preserving the alternation. The challenge is to identify and combine alternating-value runs along diagonals to form the longest such V-shaped segment (n,m ≤ 500).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.