Pra*_*ani 1 algorithm lexicographic
例如.如果我们有两个字符串2和10,如果我们按字典顺序排序,那么10将首先出现.
非常简单的解决方案将重复一个字符n次.
eg. 2 can be encoded as aa
10 as aaaaaaaaaa
This way the lex order is same as the numeric one.
Run Code Online (Sandbox Code Playgroud)
但是,有更优雅的方式来做到这一点吗?