LC 0319 [M] Bulb Switcher - ALawliet/algorithms GitHub Wiki

sheesh: https://www.youtube.com/watch?v=lyZhLR292yY&ab_channel=ShiranAfergan

how many bulbs are going to be:
on after N rounds?
=> toggled after an odd number of times?
(each bulb is toggled once per each one of its divisors)
=> in the range [1,N] have an odd number of divisors?
6
1,2,3,6
1*6
2*3
=2
(the only numbers that have an odd number of divisors are the ones that can be written as the square of an integer)
=> in the range N are perfect squares?
16
1*1
2*2
3*3
4*4
=4
sqrt(16) = 4
class Solution:
    def bulbSwitch(self, n: int) -> int:
        return int(sqrt(n))