当前位置:网站首页>2022.07.31(LC_6133_分组的最大数量)
2022.07.31(LC_6133_分组的最大数量)
2022-08-02 06:18:00 【Leeli9316】
方法:累计比较
--注意减去最后多的一次
class Solution {
public int maximumGroups(int[] grades) {
int n = grades.length;
int i = 1;
while (i <= n) {
n -= i;
i++;
}
return i - 1;//注意减去最后多的一次
}
}
边栏推荐
猜你喜欢
随机推荐
【论文精读】Geometric Structure Preserving Warp for Natural Image Stitching
两篇不错的php debug教程
MySQL Advanced - MVCC (ultra-detailed finishing)
Vscode connect to remote server "Acquiring the lock on the/home / ~ 'problem
项目开发规范
APP special test: traffic test
CAT1 4G+Ethernet development board Tencent cloud mobile phone WeChat applet display temperature and delivery control
关于ue4.27像素流送打包后的本地服务器问题
request.getSession(),的故事
MySQL (3)
HCIP day one
The stock price has repeatedly hit new lows, and the real estate SaaS giant is in trouble. How should Mingyuan Cloud transform and save itself?
笔记本开机黑屏提示:ERROR 0199:System Security-Security password retry count exceeded
Node installation and environment variable configuration
yml字符串读取时转成数字了怎么解决
Understand C operators in one article
HCIP day 3 experiment
解决C#非静态字段、方法或属性“islandnum.Program.getIslandCount(int[][], int, int)”要求对象引用
2022年7月18日-7月31日(Ue4视频教程和文档,20小时。合计1412小时,剩8588小时)
文件上传漏洞(二)