takeUforward
lexicographic-rank-of-a-string - Tutorial