You are given n bulbs, all initially turned off. You perform n rounds of toggling operations:
In round
In round
In round
In general, during round i, you toggle every i-th bulb (turning it on if it is off, or turning it off if it is on).
In round n, you toggle only the last bulb.
Return the number of bulbs that remain on after all n rounds have been completed.
Constraints:
n
You are given n bulbs, all initially turned off. You perform n rounds of toggling operations:
In round
In round
In round
In general, during round i, you toggle every i-th bulb (turning it on if it is off, or turning it off if it is on).
In round n, you toggle only the last bulb.
Return the number of bulbs that remain on after all n rounds have been completed.
Constraints:
n