Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 501 Bytes

Question_2960.md

File metadata and controls

22 lines (18 loc) · 501 Bytes

LeetCode Records - Question 2960 Count Tested Devices After Test Operations

Attempt 1: Use a loop

class Solution {
    public int countTestedDevices(int[] batteryPercentages) {
        int count = 0;

        for (int batteryPercentage : batteryPercentages) {
            if (batteryPercentage - count > 0) {
                count++;
            }
        }

        return count;
    }
}
  • Runtime: 0 ms (Beats: 100.00%)
  • Memory: 43.07 MB (Beats: 41.04%)