웅재의 코딩세상
[프로그래머스] 문자열 내림차순으로 배치하기 본문
- 풀이
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(string s) {
string answer = "";
sort(s.rbegin(), s.rend());
answer = s;
return answer;
}
반응형
'코딩테스트 > 프로그래머스 - LV 1' 카테고리의 다른 글
[프로그래머스] 두 정수 사이의 합 (0) | 2024.02.09 |
---|---|
[프로그래머스] 문자열 내 p와 y의 개수 (0) | 2024.02.09 |
[프로그래머스] 문자열 다루기 기본 (0) | 2024.02.09 |
[프로그래머스] 서울에서 김서방 찾기 (0) | 2024.02.09 |
[프로그래머스] 수박수박수박수박수박수? (0) | 2024.02.09 |