class BasicPermutationParity extends PermutationParity {

    @Override
    public int parity(long[] current) {

        int count = 0;

        for (int i = 0, n = indices.length; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                int cmp = compare(current[indices[i]], current[indices[j]]);
                if (cmp == 0)
                    return 0;
                else if (cmp > 0) count++;
            }
        }

        // value is odd, -1 or value is even +1
        return Integer.lowestOneBit(count) == 1 ? -1 : +1;
    }

    public  BasicPermutationParity(int[] indices);

}