How do I find the number of permutations of an array a such that every element of a\'s permutation is less than another array.