public class Solution { public int MaxCount(int m, int n, int[,] ops) { var row = ops.GetLength(0); var col = ops.GetLength(1);//2 if (row == 0 || col == 0) { return m * n; } var minRow = int.MaxValue; var minCol = int.MaxValue; for (int i = 0; i < row; i++) { var r = ops[i, 0]; if (r < minRow) { minRow = r; } var c = ops[i, 1]; if (c < minCol) { minCol = c; } } var result = minRow * minCol; return result; } }
https://leetcode.com/problems/range-addition-ii/#/description