C++:: 프로그래머스 < 문자열 내림차순으로 배치하기 >

jahlee·2023년 8월 9일
0

프로그래머스_Lv.1

목록 보기
69/75
post-thumbnail

내림차순 정렬하면 되는 간단한 문제이다.

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

string solution(string s) {
    sort(s.begin(), s.end(), greater<char>());
    return s;
}

0개의 댓글