23 ms·
i wonder what the complexity of the generalized version of the problem is. it is a bit similar to subset sum, which is np complete. in this problem we have 4 o
by jd007 9y ago
i wonder what the complexity of the generalized version of the problem is. it is a bit similar to subset sum, which is np complete.
in this problem we have 4 operators (+, -, /, *) to consider instead of just 1 (+), so it is more complex than subset sum in this regard. also as a result of having different operators, the ordering of the numbers matter in this case, which doesn't matter in subset sum. however the fact that we have to use each number exactly once significantly reduces the search space