Easy Python Solution


  • 0
    F

    The purpose of this problem is to calculate the size of overlapping area of every operation, the area is a rectangular area, and the length of the rectangular is the minimal number of every operation's first number, the width is the minimal number of every operation's second number.

    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
            x, y = 1e9, 1e9
            for op in ops:
                if op[0] < x:
                    x = op[0]
                if op[1] < y:
                    y = op[1]
            return x*y
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.