[프로그래머스] 문자열 내 마음대로 정렬하기
링크
https://programmers.co.kr/learn/courses/30/lessons/12915
sol1) 정렬
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/rope>
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
vector<string> solution(vector<string> strings, int n) {
vector<string> answer;
sort(strings.begin(),strings.end(),[&](const string& a,const string& b){
if(a[n] == b[n]) return a < b;
return a[n] < b[n];
});
answer = strings;
return answer;
}
Author And Source
이 문제에 관하여([프로그래머스] 문자열 내 마음대로 정렬하기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@inwooleeme/프로그래머스-문자열-내-마음대로-정렬하기저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)