How to find lexicographical order of an array of N integers(i.e. 1,2,3,...,n) in its permutations in O(n) time?
Ex:- lexicographical order of {2,3,1,4} is 9 in its permutations
How to find lexicographical order of an array of N integers(i.e. 1,2,3,...,n) in its permutations in O(n) time?
Ex:- lexicographical order of {2,3,1,4} is 9 in its permutations