# 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...