You are given an integer array batteryPercentages of length n, where batteryPercentages[i] represents the battery percentage of the device at index i.
Your task is to inspect each device sequentially from index n
If batteryPercentages[i] > 0:
Increment the total number of tested devices.
For every subsequent device at index j where i n, decrease its battery percentage by batteryPercentages[j] becomes batteryPercentages[j]
If batteryPercentages[i]
Return the total count of devices that are tested after processing all devices.
Constraints:
n batteryPercentages.length
batteryPercentages[i]
You are given an integer array batteryPercentages of length n, where batteryPercentages[i] represents the battery percentage of the device at index i.
Your task is to inspect each device sequentially from index n
If batteryPercentages[i] > 0:
Increment the total number of tested devices.
For every subsequent device at index j where i n, decrease its battery percentage by batteryPercentages[j] becomes batteryPercentages[j]
If batteryPercentages[i]
Return the total count of devices that are tested after processing all devices.
Constraints:
n batteryPercentages.length
batteryPercentages[i]