### 12.2.4 Product of cycles to permutation

The cycles2permu command does the opposite of perm2cycles; it turns a sequence of cycles into a permutation.

- cycles2permu takes c, a list of cycles.
- cycles2permu(c) returns the permutation (of size n chosen as small as possible) that is the product of the given cycles.

#### Examples

cycles2permu([[1,3,5],[2,4]])

| ⎡ ⎣ | 0,3,4,5,2,1 | ⎤ ⎦

cycles2permu([[2,4]])

| ⎡ ⎣ | 0,1,4,3,2 | ⎤ ⎦

cycles2permu([[5],[2,4]])

| ⎡ ⎣ | 0,1,4,3,2,5 | ⎤ ⎦