Previous Up Next

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.

Examples

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

Previous Up Next