Smallest dictionary segmentation

Write codeHard40 minGoogle and OpenAI style

Your task

Segment a string with no spaces into a sequence of dictionary tokens. Given s and words (a list of allowed tokens), return the lexicographically SMALLEST valid tokenization as a list of tokens, where 'lexicographically smallest' compares the resulting list of tokens element by element (shorter list is NOT automatically smaller; standard Python list comparison of the token lists). If no segmentation exists, return an empty list. s is lowercase letters; words may contain duplicates; the empty string segments to [].

Examples

segment_min(s: str, words: list[str]) -> list[str]
Example 1
Inputsegment_min("catsand", ["cat", "cats", "and", "sand"])
Output["cat", "sand"]