Skip to content

Lexicographic Enumeration Ladder

Warm-Up

  • rank or unrank simple strings or permutations
  • count all valid suffixes under a fixed prefix

Core

  • greedy reconstruction with DP counts
  • lexicographic skipping by whole blocks

Stretch

External Practice