Simple JavaScript Solution


  • 0
    var maxCount = function(m, n, ops) {
      let xMax = m;
      let yMax = n;
      ops.forEach(item => {
        xMax = xMax > item[0] ? item[0] : xMax;
        yMax = yMax > item[1] ? item[1] : yMax;
      });
      return xMax*yMax;
    }

Log in to reply
 

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