[Community Puzzle] Gold Packing

Try something like this:

1795
21
2 4 7 11 16 22 29 37 46 56 67 79 92 106 121 137 154 172 191 211 230

Answer:

2 4 7 11 16 22 29 37 46 56 67 79 92 106 121 137 154 172 191 211 230
2 Likes

Oh thanks ! You give me the solution. I just have to put a n+1 in a range instead of just n. Hope this can help RRRoumy too.

Cant pass hidden validator 3. How can I debug it?

Thx, is it possible to add the Yatech test for other users ?
Difficult to find the mistake if a case is not tested but is in the validators…

I found this challenge very educational. Thank you.

But I do have a suggestion:
I was able to fairly easily solve all the test cases, but the 4th validation test took me down an entirely different path, and it took me a long long time to figure it out, and I was only able to ultimately solve it using your hint of the 1565 goal example.
So, my suggestion is that if you are going to have 20 gold bars in a validator, you should have 20 gold bars in a test case too.

1 Like

Wow. Can’t believe this is almost 3 years old. Shows how far behind the times I am. :wink:
Anyway, thought this was a fun one. I tried a naive DFS approach first which resulted in the correct answers, but timed out for test case #4. Ended up using a bitset approach which worked fine and was satisfying to implement. I don’t think this really qualifies as an “easy” puzzle, but thanks for creating it.