2960. 统计已测试设备

统计已测试设备

解法一: 一次遍历

go
1
2
3
4
5
6
7
8
9
func countTestedDevices(batteryPercentages []int) int {
ans := 0
for _, batteryPercentage := range batteryPercentages {
if batteryPercentage-ans > 0 {
ans++
}
}
return ans
}
作者

wuhunyu

发布于

2024-05-10

更新于

2024-09-05

许可协议

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×