class Solution {
public long[] solution(int x, int n) {
long[] answer = new long[n];
long num = x;
for(int i = 0; i < answer.length; i++){
answer[i] = num;
num += x;
}
return answer;
}
}
'Algorithm > 프로그래머스' 카테고리의 다른 글
[Lv. 1] 자연수 뒤집어 배열로 만들기 (0) | 2023.04.24 |
---|---|
[Lv. 1] 문자열 내 p와 y의 개수 (0) | 2023.04.24 |
[Lv. 1] 나머지가 1이 되는 수 찾기 (0) | 2023.04.21 |
[Lv. 1] 자릿수 더하기 (0) | 2023.04.20 |
[Lv. 0] 두 수의 연산값 비교하기 (0) | 2023.04.20 |
댓글