Gapplet

Compute the product of two permutations g, h.

g = [4,3,1,5,2] means that g permutes {1,2,3,4,5} according to

g(1) = 4,  g(2) = 3,  g(3) = 1,  g(4) = 5,  g(5) = 2.


First input permutation g 
e.g., [5,4,3,2,1]
Then input permutation h 
e.g., [5,4,2,3,1]
 
 
Compute gh