def solution(x, n):
answer = []
for i in range(n):
answer.append(x*(i+1))
return answer
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*(i+1);
}
return answer;
}
}
long[] answer = new long[6];
는 파이썬의 answer = [0,0,0,0,0,0]
과 같다는 걸 배웠습니다.