Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Each monster can only have two states. They are either alive or dead.
We can use bitmasks to represent every possible combination of alive and dead monsters.
Let dp[mask] represent the minimum number of days needed to reach the state mask.