Notes

Home

❯

2 Area

❯

코딩테스트

❯

템플릿화

❯

2차원 배열에서 가장 많이 증가된 값의 개수

2차원 배열에서 가장 많이 증가된 값의 개수

Sep 08, 20251 min read

https://leetcode.com/problems/range-addition-ii/description/

class Solution {
    public int maxCount(int m, int n, int[][] ops) {
        int minRow = m;
        int minCol = n;
 
        for (int[] op : ops) {
            minRow = Math.min(minRow, op[0]);
            minCol = Math.min(minCol, op[1]);
        }
 
        return minRow * minCol;
    }
}

Graph View

Created with Quartz v4.5.1 © 2025