Skip to content

PermutationListQ

Tests whether a list represents a permutation of {1, …, n}.

$ wo 'PermutationListQ[{3, 1, 2}]'
True
$ wo 'PermutationListQ[{1, 2, 2}]'
False