Strings in lexicographic order (silo)¶
The function silo can be used to iterate through strings in lexicographic order in some range.
- silo(alphabet: str, upper_bound: int, first: str, last: str) Iterator ¶
Returns an iterator to strings in lexicographic order (silo).
- Parameters
- Returns
An iterator to strings in lexicographic order over the alphabet
alphabet
of length at mostupper_bound
in the range[first, last)
.
>>> from libsemigroups_pybind11 import silo >>> list(silo("ba", 3, "b", "aaa")) ['b', 'bb', 'ba', 'a', 'ab', 'aa']