class Solution {
public int[] solution(int n) {
int[] answer = {};
return answer;
}
}
class Solution {
public int[] solution(int n) {
int count = 0;
for (int i = 1; i <= n; i++) {
if (n % i == 0) {
count++;
}
}
int[] answer = new int[count];
count = 0; // count를 다시 0으로 초기화시켜준다
for (int i = 1; i <= n; i++) {
if (n % i == 0) {
answer[count++] = i;
}
}
return answer;
}
}