319. Bulb Switcher Solution 1 (time O(1), space O(1)) class Solution(object): def bulbSwitch(self, n): """ :type n: int :rtype: int """ return int(sqrt(n))