Description
There are n bulbs initially off. For round i, you toggle every ith bulb. After n rounds, how many bulbs are on? Return the result as an integer.
Examples
Input:
n = 3Output:
1Explanation:
Only bulb 1 remains on.
Input:
n = 0Output:
0Explanation:
With 0 bulbs, there are no bulbs to toggle, so 0 bulbs remain on.
Input:
n = 1Output:
1Explanation:
With 1 bulb, round 1 toggles it ON. Only bulb 1 remains on (perfect square positions stay on).
Constraints
- •
0 ≤ n ≤ 10⁹