Implementation - Hidden N-tuples
This is legitamately hard. The only thing I can really think of is brute forcing the permutations.
I keep staring at this and hoping I can convert it into a graph-theory question or an exact cover problem. I haven't yet.