Description
Solutions
Find Longest Diagonal Segment
🤘 INTERN

Plz check out the source image below for the original problem statement :)

Example 1:

Input:  matrix = [[0, 0, 1, 2], [0, 2, 2, 2], [2, 1, 0, 1]]
Output: 3
Explanation:
Just my educated guess. might be right might be wrong - The longest diagonal segment following the pattern 1, 2, 0, 2, 0, 2, 0, ... can be found starting from the element at row 2, column 1 (1-based index), going up and to the right. The segment is [1, 2, 0], which has a length of 3.
Constraints:
    TO-DO
Thumbnail 0
Thumbnail 1
Testcase

Result
Case 1

input:

output: