← ALL NOTES
Array

3459. Length of Longest V-Shaped Diagonal Segment

Given a matrix of 0/1/2. Find the length of the longest V-shaped diagonal segment: values alternate 1,2,0,2,0,... along a diagonal, start with 1, and at most one 90°-clockwise turn in the diagonal…

Loading…