문제 상황

<aside> 💡 함수 solution은 정수 x와 자연수 n을 입력 받아, x부터 시작해 x씩 증가하는 숫자를 n개 지니는 리스트를 리턴해야 합니다. 다음 제한 조건을 보고, 조건을 만족하는 함수, solution을 완성해주세요.

</aside>


나의 답변

#include <string>
#include <vector>

using namespace std;

vector<long long> solution(int x, int n) 
{
    vector<long long> answer;
    for(int i=0 ; n > i ; i++) answer.push_back(x+x*i);
    return answer;
}

다른 사람들 답변에서 알게 된점 & 메모 내용