class Solution {
public:
static bool cmp(int a,int b){
string s1 = to_string(a) + to_string(b);
string s2 = to_string(b) + to_string(a);
return s1 < s2;
}
string printMinNumber(vector<int>& nums) {
string str;
if(!nums.size()) return str;
sort(nums.begin(),nums.end(),cmp);
for(auto x:nums)
str += to_string(x);
return str;
}
};