Python solution


  • 0
    H
    class Solution(object):
        def bulbSwitch(self, n):
            """
            :type n: int
            :rtype: int
            """
            i=0
            while i*i<=n:
                i+=1
            return i-1

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.