Previous Up Next

2.10.6  Checking for a permutation : is_permu

is_permu is a boolean function.
is_permu takes as argument a list.
is_permu returns 1 if the argument is a permutation and returns 0 if the argument is not a permutation.
Input :

is_permu([2,1,3])

Output :

0

Input :

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

Output :

1

Previous Up Next