MFINE Hiring | Interview Question | Off-Campus OA (2022)

Question · Posted Jun 2026

Q1: Difference Between Ones and Zeros in Row and Column Problem Statement You are given an m × n binary matrix grid. For every cell (i, j) compute: diff[i][j] = onesRow[i] + onesCol[j] - zerosRow[i] - zerosCol[j] Return the resulting matrix diff. Example Input grid = [  [0,1,1],  [1,0,1],  [0,0,1] ] Output [  [ 0, 0, 4],  [ 0, 0, 4],  [-2,-2, 2] ] Constraints 1 <= m, n <= 10^5 1 <= m * n <= 10^5 grid[i][j] ∈ ...

The full answer & interview discussion are available to premium members.

Log in Create a free account