x만큼 간격이 있는 n개의 숫자

han.user();·2023년 4월 12일
0

프로그래머스

목록 보기
59/87
post-thumbnail

class Solution {
    public long[] solution(int x, int n) {
        
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = x * (i + 1);
        }
        return arr;
    }
}
profile
I'm still hungry.

0개의 댓글