For this Question: There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.
On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the ith round, you toggle every i bulb. For the nth round, you only toggle the last bulb.
Return the number of bulbs that are on after n rounds.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>bulbSwitch()</b> that takes the integer n as a parameter.

<b>Constraints</b>
1 &le; n &le; 10<sup>5</sup>Return the number of bulbs that are on after n rounds.Sample input:
3

Sample output:
1

<b>Explanation</b>
 At first, the three bulbs are [off, off, off].
After the first round, the three bulbs are [on, on, on].
After the second round, the three bulbs are [on, off, on].
After the third round, the three bulbs are [on, off, off]. 
So you should return 1 because there is only one bulb is on., I have written this Solution Code: class Solution {
public int bulbSwitch(int n) {
int on = 0;
for (int i = 1; i * i <= n; i++) {
on++;
}

    return on;
}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?