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
asked Oct 8, 2015 at 4:04
weedfarmer
511 gold badge1 silver badge6 bronze badges
{777, 99999, -8888, 5000000}(which yields the same result), I imagine it will be more difficult.