Computes the parity of a permutation.
var sgn = require("permutation-parity")
console.log(sgn([0, 1, 2]), sgn([0, 2, 1]))npm install permutation-parity
Determines the sign of a permutation
pis a permutation
Returns The sign of the permutation:
1ifpis odd-1ifpis even0ifpis not a permutation
(c) 2014 Mikola Lysenko. MIT License