Plz check out the source image below for the original problem statement :)
Examples
01 · Example 1
matrix = [[0, 0, 1, 2], [0, 2, 2, 2], [2, 1, 0, 1]] return = 3
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.
More Roblox problems
- Candy Crush Grid Matching and GravityPHONE SCREEN · Seen Jun 2026
- Closest Binary Search Tree Value VariantPHONE SCREEN · Seen Jun 2026
- Design Search Autocomplete SystemPHONE SCREEN · Seen Jun 2026
- Find the Closest PalindromePHONE SCREEN · Seen Jun 2026
- Grid Pathfinding with Obstacles (DFS)PHONE SCREEN · Seen Jun 2026
- Maximize Distance to Closest PersonPHONE SCREEN · Seen Jun 2026
- Maximum Number of Balls in a BoxPHONE SCREEN · Seen Jun 2026
- Meeting Rooms IIPHONE SCREEN · Seen Jun 2026
public int solution(int[][] matrix) {
// write your code here
}
matrix[[0, 0, 1, 2], [0, 2, 2, 2], [2, 1, 0, 1]]
expected3
sign in to submit