leetcode598
public class Solution {
public int MaxCount(int m, int n, int[,] ops) {
var row = ops.GetLength();
var col = ops.GetLength();//
if (row == || col == )
{
return m * n;
}
var minRow = int.MaxValue;
var minCol = int.MaxValue;
for (int i = ; i < row; i++)
{
var r = ops[i, ];
if (r < minRow)
{
minRow = r;
}
var c = ops[i, ];
if (c < minCol)
{
minCol = c;
}
}
var result = minRow * minCol;
return result;
}
}
https://leetcode.com/problems/range-addition-ii/#/description
leetcode598的更多相关文章
- [Swift]LeetCode598. 范围求和 II | Range Addition II
Given an m * n matrix M initialized with all 0's and several update operations. Operations are repre ...
- Leetcode598.Range Addition II范围求和2
给定一个初始元素全部为 0,大小为 m*n 的矩阵 M 以及在 M 上的一系列更新操作. 操作用二维数组表示,其中的每个操作用一个含有两个正整数 a 和 b 的数组表示,含义是将所有符合 0 < ...
随机推荐
- react bootstrap-loader
1.install npm install bootstrap-loader jquery resolve-url-loader 2.webpack.config.js entry: ['bootst ...
- 使用jmeter做web接口测试
接口测试概述 定义 API testing is a type of software testing that involves testing application programming in ...
- mcake活动维护常见问题记录【pc端】 ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
★ ★ ★ ★ ★ ★ ★ ★ ★ ★pc端问题及解决方法 ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ 问题一.pc.弹窗,背景兼容ie8的写法 ;;; -moz-opacity:.7;f ...
- android textview xml 属性设置
android:ems 设置TextView的宽度为N个字符的宽度. android:maxems 设置TextView的宽度为最长为N个字符的宽度.与ems同时使用时覆盖ems选项. andr ...
- Games Delphi developers play
Original link: Games Delphi developers play Delphi game developers are stupid people having too ma ...
- 打印机无法使用且无法重新安装,提示spooler service is not running
使用场景:之前安装好的打印服务今天突然无法使用,列表里面找不到打印机,于是重新安装,得到以下错误: The local print spooler service is not running. Pl ...
- RPi 2B QEMU 模拟树莓派
/******************************************************************************** * RPi 2B QEMU 模拟树莓 ...
- HDU - 6183:Color it (线段树&动态开点||CDQ分治)
Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B ...
- HDU - 6129 :Just do it (杨辉三角)
There is a nonnegative integer sequence a 1...n a1...n of length n n . HazelFan wants to do a type ...
- Eclipse环境搭建配置操作
1.选择window 2.设置字体 3.设置编码格式:国际编码:UTF-8 第一个地方设置编码格式 第二个地方设置编码格式:这个更重要些 4.配置26个英文小写字母. 作用:能够在开发时提示你,快速开 ...