Skip to main content

319. Bulb Switcher

Python

import math


class Solution:
def bulbSwitch(self, n: int) -> int:
if n <= 1:
return n
return int(math.sqrt(n))