[프로그래머스 문제풀이65]x만큼 간격이 있는 숫자 자바

이ᄏᄋ·2021년 9월 30일
0
class Solution {
    public long[] solution(long x, int n) {
        long[] answer = new long[n];
        for(int i=0;i<n;i++){
            answer[i]=x*(i+1);
        }
        return answer;
    }
}

js로 풀다가 타입을 명시해야 하는 언어로 푸니까 타입형으로도 장난 친다는 것을 깨닫고 있다. ㅋㅋ

profile
미쳤다.

0개의 댓글