You are not clearing the ‘samples’ or at least I don’t see it. That is not the problem though, what bothers me is that you push samples by their ID instead of just ‘i’, and you later on get them by ‘i’, which I think is a mistake.
ps. I think I see what you are trying to do, but it’s not necessary. You can handle the samples as you do robots and molecules. Generally, the IDs shouldn’t be trusted.
For the record, I did use the same methodology (private class and HashMap) to collect inputs on another puzzle yesterday and it worked fine as usual.
Therefore I think it is more an internal problem coming from the platform. Does someone know how can I address this problem to CodinGame people please ?
not a Java expert here but I played a bit with your code and started getting proper results when I got rid of static variables and static inner classes, so I’d look into that.
Sure I assume they are part of the problem. However I don’t understand why as I code all my puzzles using static variables and static inner classes and never experienced this problem before.
Anyway, I will do this one using other techniques, thanks for your feedback.