https://school.programmers.co.kr/learn/courses/30/lessons/77884
for (int i = 1; i * i <= result[j]; i++)
(result[j] % i == 0) count += 2
(i * i == result[j]) count++;
class Solution {
public int solution(int left, int right) {
int answer = 0;
int start= left;
int[] result = new int[right-left+1];
for(int i =0; i<right-left+1;i++){
result[i]=start;
start++;
}
for(int j =0; j < right-left+1; j++){
int count =0;
for (int i = 1; i * i <= result[j]; i++) {
if (i * i == result[j]) count++;
else if (result[j] % i == 0) count += 2;
}
if(count%2==0){
answer += result[j];
}
else{
answer += result[j]*(-1);
}
System.out.println(answer);
}
return answer;
}
}