5 ms·
Amazing game! Solving it sounds like a LeetCode exercise.
by alexmolas 4y ago
Amazing game! Solving it sounds like a LeetCode exercise.
- xxs 4y agoSolving it in general is quite trivial - solving it 'fast' is another story. I can write a backtracking algorithm or a constant propagation one on spot. Yet, I am not quite sure how efficient the latter would be, the former is obvious a brute force one.
- sebzim4500 4y agoIt's almost certainly NP complete, so an asymptopically fast solution would be one hell of an achievement.
- Jensson 4y agoIt is subset sum, it is definitely NP complete.