Checking for a permutation

### 12.2.7 Checking for a permutation

A permutation can be written as a list, but not every list corresponds to a permutation. The is_permu is a boolean function which checks to see if a given list is a permutation.

- is_permu takes L, a list.
- is_permu(L) returns 1 if L is a permutation and returns 0 if L is not a permutation.

#### Examples

is_permu([2,1,3])

0 |  |  |  |  |  |  |  |  |  |

is_permu([2,1,3,0])

1 |  |  |  |  |  |  |  |  |  |