Counting Countdown Timers After N Days

Algorithm · C3.ai · Medium

You are given a list of timers. Every day, the value of each timer drops by one. Whenever a timer hits zero, that timer resets, and at the same moment one brand-new timer is appended to the list. Given a number of days, simulate this process and return how many timers the list contains once that many days have elapsed. Examples Example 1 Example 2

Loading the rest of the question…