题目
分析
这里官方分析的很好,就直接采用官方的分析了
代码
C++
class Solution {
public:
int bulbSwitch(int n) {
return (int)sqrt(n);
}
};
Java
class Solution {
public int bulbSwitch(int n) {
return (int) Math.sqrt(n + 0.5);
}
}
作者:LeetCode-Solution



