LEGION SYSTEMS Hiring Challenge | Off-Campus OA (2021) | Matrix Counting
Question · Posted Jun 2026
Problem: Cells with Odd Values in a Matrix You are given an m × n matrix initialized with all zeros and an array indices, where each indices[i] = [ri, ci]. For every operation: Increment all cells in row ri by 1. Increment all cells in column ci by 1. Return the number of cells having odd values after performing all operations. Example Input m = 2 n = 3 indices = [[0,1],[1,1]] Output 6 Explanation Initial Matrix: 0 0 0 ...
The full answer & interview discussion are available to premium members.
Log in Create a free account