2 ms·
You can optimize the search, a naive solution would brute force all possible solutions. But you can cut the search short, so adding cuts in the right places w
by segmondy 5y ago
You can optimize the search, a naive solution would brute force all possible solutions. But you can cut the search short, so adding cuts in the right places will speed it up even tho it doesn't make it pure. You can also memoize results. The difference between a naive and an optimized solution in prolog is orders of magnitude difference.