class Solution {
public:
vector lexicalOrder(int n) {
map nums;
vector res;
for(int i=1;i<=n;++i){
nums[to_string(i)]=i;
}
for(auto iter=nums.begin();iter!=nums.end();iter++){
res.push_back(iter->second);
}
return res;
}
};
```
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)