๋ฌธ์
์ฝ๋
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(char a, char b){
if(a>'a'&&a<'z'&&b>'a'&&b<'z') return a>b; //๋๋ค ์๋ฌธ์ ์ผ ๊ฒฝ์ฐ
else if(a>'a'&&a<'z'&&b>'A'&&b<'B') return a<b; //B๊ฐ ๋๋ฌธ์์ผ ๊ฒฝ์ฐ
else return a>b;
}
string solution(string s) {
string answer = "";
vector<char>v;
for(int i=0; i<s.length(); i++){
v.push_back(s[i]);
}
sort(v.begin(),v.end(),cmp);
for(char c:v){
answer+=c;
}
return answer;
}
๋๊ธ