Available question text
Given a binary matrix, return the length of the longest consecutive line of 1s appearing horizontally, vertically, diagonally, or anti-diagonally. Typical solutions scan the matrix while maintaining counts for the four directions per cell (DP/directional accumulation) to achieve O(mn) time.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 562. Longest Line of Consecutive One in Matrix
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source