当前位置:网站首页>LeetCode 1351. Counting Negative Numbers in Ordered Matrices (Simple)
LeetCode 1351. Counting Negative Numbers in Ordered Matrices (Simple)
2022-08-10 05:56:00 【Shengxin Research Ape】
python
class Solution:
def countNegatives(self, grid: List[List[int]]) -> int:
count = 0
for i in range(len(grid)):
for j in range(len(grid[i])):
if(grid[i][j]<0):
break
if(grid[i][j]<0):
count += len(grid[i]) - j
return count

边栏推荐
- 开源免费WMS仓库管理系统【推荐】
- LeetCode 1720.解码异或后的数组(简单)
- Linux数据库Oracle客户端安装,用于shell脚本用sqlplus连接数据库
- 程序员副业赚钱之道,实现月收入增加20K
- shell脚本中利用sqlplus操作数据库
- .NET操作Excel高效低内存的开源框架 - MiniExcel
- String common methods
- Notes 1
- Ten years of sharpening a sword!The digital collection market software, Link Reading APP is officially open for internal testing!
- network security firewall
猜你喜欢

The latest and most complete digital collection sales calendar-07.26

LeetCode 938. Range Sum of Binary Search Trees (Simple)

PyTorch之模型定义

Chain Reading | The latest and most complete digital collection calendar-07.28

微信小程序--模板与设置WXML

Common class String overview

反射【笔记】

Collection Map

程序员副业赚钱之道,实现月收入增加20K
![[Notes] Collection Framework System Collection](/img/6a/f0e69ebb60a3d958ec7bda33a60995.png)
[Notes] Collection Framework System Collection
随机推荐
菜谱小程序源码免费分享【推荐】
MySql constraints
常用类 BigDecimal
卷积神经网络(CNN)实现服装图像分类
Timer (setInterval) on and off
Using sqlplus to operate database in shell script
Analysis of the investment value of domestic digital collections
基于 .NET Core MVC 的权限管理系统
力扣——情侣牵手
The complex "metaverse" will be interpreted for you, and the Link Reading APP will be launched soon!
ACID四种特性
一个基于.Net Core跨平台小程序考试系统
LeetCode 100.相同的树(简单)
LeetCode 1894. Find the student number that needs to be supplemented with chalk
pytorch-07.处理多维特征的输入
LeetCode 剑指offer 21.调整数组顺序使奇数位于偶数前面(简单)
pytorch-06. Logistic regression
Chain Reading|The latest and most complete digital collection sales calendar-07.29
测一测异性的你长什么样?
pytorch-08.加载数据集