598. Range Addition II

来源:互联网 发布:淘宝店3c认证怎么办理 编辑:程序博客网 时间:2024/06/04 22:55
class Solution(object):
    def maxCount(self, m, n, ops):
        """
        :type m: int
        :type n: int
        :type ops: List[List[int]]
        :rtype: int
        """
        if not ops: return m * n

        return min(op[0] for op in ops) * min(op[1] for op in ops)

http://bookshadow.com/weblog/2017/05/28/leetcode-range-addition-ii/

求数组元素操作后的最大值的个数