import java.util.ArrayList; class Solution { public int solution(int n) { int answer = 0; ArrayList<Integer> arr = new ArrayList<Integer>(); for (int i = 1 ; i <= n;i++ ){ if(n%i==0){ arr.add(i); } } System.out.println(arr.get(arr.size()/2+1)); if(n == arr.get((arr.size()-1)/2)*arr.get((arr.size()-1)/2)){ answer = 1 ; }else{ answer = 2; } return answer; } }