Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions LeetCode/0319_BulbSwitcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The bulbs that will be turned on in the end will be the ones that are perfect squares.
# So we just have to find the perfect square less than n; Square root of which will be the answer.
# Contributed by: Sahil Bairagi

class Solution:
def bulbSwitch(self, n: int) -> int:
return int(n**(0.5))