dp with size 2^n (where n is the number of monsters) and fill it with infinity. The DP array will hold the minimum days required to defeat monsters for each state.dp[0] to 0 since no days are needed if no monsters are to be defeated.1 to 2^n - 1.1.dp[2^n - 1] as the answer, which represents the minimum days needed to defeat all monsters.