Lexicographic unranking (source code)

= Lexicographic unranking

Lexicographic unranking constructs the object at a specified position in <lexicographic order>. At each step it counts valid completions for each possible next symbol, skips blocks preceding the desired rank, and continues within the selected block.