반응형
class Solution {
public long[] solution(int x, int n) {
long[] answer = new long[n];
int temp = 0;
for (int i=0; i<n; i++){
temp += x;
answer[i] = temp;
}
return answer;
}
}
반응형
'코딩 테스트 > 알고리즘' 카테고리의 다른 글
[알고리즘 파이썬] 우선순위 큐(Priority Queue) (0) | 2021.12.21 |
---|---|
이것이 코딩 테스트다 :: 그래프 이론 (0) | 2021.05.16 |
[알고리즘 파이썬] DFS/BFS (0) | 2021.02.24 |
[알고리즘 파이썬] sort(), sorted() 차이 (0) | 2021.02.13 |
[알고리즘 파이썬] 다이나믹 프로그래밍 (0) | 2021.02.08 |