β back to unit
Easy
# breaking it down easy
Battery Bar
The tablet starts the day full of promise. The apps have other plans. π
You get the starting charge percent and the hourly usage amounts, in order. Print the hour number (1, 2, 3β¦) when the charge first hits 0 or below β or survived if it lasts through the whole list.
Example:
Input: charge = 100, usage = [30, 40, 20, 15]
Output: 4
After each hour the charge is 70, 30, 10, -5 β it first drops to 0 or below on hour 4.
π‘ need a hint?
brk-battery-bar.pyπ given lines are locked β write your code in between
loading...