class Solution { public int bulbSwitch(int n) { return (int)Math.sqrt(n); } } 一个数x,其因数个数是奇数个可以知道x是平方数