edit: you put tiles at random for shuffle? It's not correct for the hard level. Only even permutations are accessible.
edit: maybe I was tired when counting my permutations, forget the last edit