2 ms·
Yeah, so I guess whether or not this would be practical would depend on how large the OP's initial data set is. One thing you could possibly do, if the set does
by mindcrime 8y ago
Yeah, so I guess whether or not this would be practical would depend on how large the OP's initial data set is. One thing you could possibly do, if the set doesn't have negative numbers, is throw out any numbers larger than X, since they can't be part of an answer.
If the OP needs all the matching answers, I don't think there's any way to do it that doesn't essentially reduce to generating the power set though. If they just need one answer, there might be a simpler way.