classSolution { public: stringlargestNumber(vector<int>& nums){ sort(nums.begin(), nums.end(), [=](int a, int b){ longlong ab = func(a, b), ba = func(b, a); return ab > ba; }); string re; for(int i = 0; i < nums.size(); i++){ re += to_string(nums[i]); } auto iter = re.begin(); for(; iter != re.end() && (*iter) == '0'; iter++); if(iter == re.end()) returnstring("0"); elsereturnstring(iter, re.end()); } longlongfunc(int a, int b){ if(b == 0) return a * 10; longlong re = a; int t = b; while(t > 0) { re *= 10; t /= 10; } return re + b; } };