#include <string> #include <vector> #include <algorithm> using namespace std; string solution(string s) { string answer = ""; sort(s.rbegin(), s.rend()); answer.append(s); return answer; }
참고 : http://www.soen.kr/lecture/ccpp/cpp4/39-3-3.htm