function solution(n) { let root = n ** 0.5; if(Number.isInteger(root)) return (root+1)**2; else return -1; }