Leetcode 2960. Count Tested Devices After Test Operations
Process the array left-to-right: whenever batteryPercentages[i] > 0 you test that device (increment count) and all later devices lose 1 battery (floored at 0). Equivalently, return the number of indices i for which batteryPercentages[i] is greater than the number of previously successful tests.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.