That's not helpful, I already wrote that I tried bruteforcing and that takes too long for the larger sets.
| [reply] |
its not exactly a bruteforce, but it can't have a straight answer either. any algorithm that solve this kind of problem will use heuristics, you can't do better than this.
here is my try, didn't tried my algorithm against the others, don't know which is faster, anyway
| [reply] [d/l] |