https://school.programmers.co.kr/learn/courses/30/lessons/120854
각 원소의 길이 계산해서 저장
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> strlist) {
vector<int> answer;
for(const auto& s : strlist)
{
answer.push_back(s.length());
}
return answer;
}
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> strlist) {
vector<int> answer;
for(auto str : strlist)
answer.push_back(str.length());
return answer;
}
같은 방법이다.