I\'m reading the numbers 0, 1, ..., (N - 1) one by one in some order. My goal is to find the lexicography index of this given permutation, using only O(1)
0, 1, ..., (N - 1)
O(1)
There are N! permutations. To represent index you need at least N bits.