Fewest emergency restocks to keep inventory valid
Your stock changes every day by task[i] (positive or negative). On days where task[i] == 0 the stock is checked and must not be negative, and at no time may the stock exceed max_products. On any day you may do an emergency restock and set the stock to whatever you like. Return the fewest restock days needed, or -1 if it cannot be done.
No answer yet. Write the first one; the best answer gets endorsed.
