본문으로 바로가기
728x90
반응형

문제

 

 

반응형

풀이

 

 

 

1
2
3
4
5
6
7
8
9
10
class Solution {
    public long[] solution(int x, int n) {
        long[] answer = new long[n];
        
        for(long i=0; i<n; i++) {
            answer[(int)i]=x+(x*i);  //answer의 i번째에 x 부터 x씩 증가한 정수를 넣음
        }
        return answer;
    }
}
cs

 

728x90
반응형