diff --git "a/Programmers/\352\260\200\354\236\245_\355\201\260_\354\210\230.cpp" "b/Programmers/\352\260\200\354\236\245_\355\201\260_\354\210\230.cpp" new file mode 100644 index 0000000..b8a139a --- /dev/null +++ "b/Programmers/\352\260\200\354\236\245_\355\201\260_\354\210\230.cpp" @@ -0,0 +1,28 @@ +#include +#include +#include + +using namespace std; + +string solution(vector numbers) { + vector strNumbers; + + for (int num : numbers) { + strNumbers.push_back(to_string(num)); + } + + sort(strNumbers.begin(), strNumbers.end(), [](const string& a, const string& b) { + return a + b > b + a; + }); + + if (strNumbers[0] == "0") { + return "0"; + } + + string result = ""; + for (const string& num : strNumbers) { + result += num; + } + + return result; +} \ No newline at end of file