Coffee Cup Combo
Last updated
Last updated
This is an easy question. The idea is to use two variables to store the coffee left after each lecture and the number of lectures Jonna can stay awake.
If you encounter a coffee machine, update the left
to be 2 and increment sum
by 1.
Otherwise, if there is coffee left, decrement left
by 1 and increment sum
by 1.