프로그래머스LV1 - x만큼 간격이 있는 n개의 숫자

Kong-al·2022년 10월 3일
0

프로그래머스LV1 - x만큼 간격이 있는 n개의 숫자

[ 답안 ]

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;
  }
}
profile
웹개발 공부중!(❁´◡`❁)

0개의 댓글