Solved, using the most efficient permutation function built so far, the solution is brute force, runs 10.2s