double root = Math.sqrt(n);
class Solution { public int solution(int n) { int answer = 0; double root = Math.sqrt(n); if(root == (int)root) { return 1; } else { return 2; } } }