Available question text
For each cell in an m×n grid, compute answer[r][c] = |(# distinct values strictly on the diagonal above‑left of (r,c)) − (# distinct values strictly on the diagonal below‑right of (r,c))|. The key is to process each bottom‑right diagonal independently and derive per‑cell prefix/suffix distinct counts to fill the answer matrix efficiently.
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 2711. Difference of Number of Distinct Values on Diagonals
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source