[99클럽 코테 스터디 2일차 TIL] 프로그래머스 - x만큼 간격이 있는 n개의 숫자
99클럽 코테 스터디 2일차 TIL 입니다.
[level 1] x만큼 간격이 있는 n개의 숫자 - 12954
성능 요약
문제 설명
x
n
answer
풀이 코드
class Solution {
public long[] solution(int x, int n) {
long[] answer = new long[n];
for (int i = 0; i < n; i++) {
answer[i] = (long) x * (i + 1);
}
return answer;
}
}돌아보기
개선하기
다음에는
Last updated