Available question text
Count the number of axis-aligned right triangles formed by three 1s in a binary grid, where one vertex shares a row with a second 1 and a column with a third (i.e., the right angle is at their intersection). With grid sizes up to 1000×1000, the task is to aggregate contributions of each 1 based on counts of 1s in its row and column to achieve an O(n·m) solution.
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 3128. Right Triangles
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source