public long[] solution(int x, int n) { long[] answer = new long[n]; long value = x; for (int i = 0; i < n; i++) { answer[i] = value; value += x; } return answer; }
출처:https://school.programmers.co.kr/learn/courses/30/lessons/12954