3 ms·
Yes, I believe it is something like O(n) where n is the sum of all the distances. It's probably related to the "pseudopolynomial time subset-sum" algorithm.
by userbinator 12y ago
Yes, I believe it is something like O(n) where n is the sum of all the distances.
It's probably related to the "pseudopolynomial time subset-sum" algorithm.