The ghost exploration team find some 1D coordinate where the cursed object is located. You will be g…
Click here to read the complete problem statement.
If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.
num should start at 0, since this would mean everytime we have a new number, the existing subset that could be divisible by 2520 would double.
On top of that, dp[1] should not be initialized, since this means that there already exist a subset with remainder 1. To add, after the for loop you should add dp_new[rem] by one, to account for the subset that only contain that new number