Solving Cells with Odd Values in a Matrix in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input: n = 2, m = 3, indices = [[0,1],[1,1]]
Output: 6
Explanation: Initial matrix = [[0,0,0],[0,0,0]].
After applying first increment it becomes [[1,2,1],[0,1,0]].
The final matrix will be [[1,3,1],[1,3,1]] which contains 6 odd numbers.

Example 2:

Input: n = 2, m = 2, indices = [[1,1],[0,0]]
Output: 0
Explanation: Final matrix = [[2,2],[2,2]]. There is no odd number in the final matrix.

Constraints:

  • 1 <= n <= 50

  • 1 <= m <= 50

  • 1 <= indices.length <= 100

  • 1 <= n <= 50

  • 1 <= m <= 50

  • 1 <= indices.length <= 100

See the full details of the problem Cells with Odd Values in a Matrix at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go