Permutation of elements in array + composition of functions resulting into an extremely inefficient runtime?

Hi there, take a look at my cube solver: My trial to make a mapping of (2x2x2 rubik’s cube, poket cube, mini cube)’s states with solutions.Recursive function wanted.
I know it is a bit messy haha…
You could only use 7 numbers in cp and co it is sufficient to describe the cube, but not much difference.Message me if you are interested.