Finding the index of a given permutation

前端 未结 7 549
闹比i
闹比i 2020-12-10 15:38

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)

7条回答
提交回复
热议问题