[Python] str 先比較 len 再比較 Lexicographic Order

min(..., key=lambda s: (len(s), s))

Ref: Lexicographic Order

Last Updated on 2023/08/16 by A1go

Bitnami