Question: Is there a Maple-function that returns a number of transpositions needed to transform a list into a list with some particular order?

Hello
Is there a Maple-function that returns a number of transpositions needed to transform a list into a list with some particular order? Actually, I need just a parity of a number of transpositions. All elements of a list are different.

For example, one needs 4 (even) transpositions to transform a list [w,x,y,z] into a list [y,x,z,w]:
[w,x,y,z]->[w,y,x,z]->[y,w,x,z]->[y,x,w,z]->[y,x,z,w]

Thank you

Please Wait...