Available question text
Given a binary m×n matrix, return a diff matrix where diff[i][j] = onesInRow(i) + onesInCol(j) - zerosInRow(i) - zerosInCol(j), i.e., the difference between the number of ones and zeros in that cell's row and column. Precompute row and column counts and combine them for each cell (expected O(mn) time, O(m+n) space; m*n ≤ 1e5).
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 2482. Difference Between Ones and Zeros in Row and Column
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source