Coupang interview question

Dynamic programming question, related to bacteria survival.