← Questions
Fewest emergency restocks to keep inventory valid
0
I was asked this
No reports yet. Sign in to say where you were asked it.
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 official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
