diff --git a/solution/0300-0399/0319.Bulb Switcher/README.md b/solution/0300-0399/0319.Bulb Switcher/README.md index 0033359fc94ec..69c05d326e9f9 100644 --- a/solution/0300-0399/0319.Bulb Switcher/README.md +++ b/solution/0300-0399/0319.Bulb Switcher/README.md @@ -63,6 +63,9 @@ ```python +class Solution: + def bulbSwitch(self, n: int) -> int: + return int(n ** (1 / 2)) ``` diff --git a/solution/0300-0399/0319.Bulb Switcher/README_EN.md b/solution/0300-0399/0319.Bulb Switcher/README_EN.md index 0e75923efc308..d0ae74a07b766 100644 --- a/solution/0300-0399/0319.Bulb Switcher/README_EN.md +++ b/solution/0300-0399/0319.Bulb Switcher/README_EN.md @@ -50,6 +50,9 @@ So you should return 1 because there is only one bulb is on. ### **Python3** ```python +class Solution: + def bulbSwitch(self, n: int) -> int: + return int(n ** (1 / 2)) ``` diff --git a/solution/0300-0399/0319.Bulb Switcher/Solution.py b/solution/0300-0399/0319.Bulb Switcher/Solution.py new file mode 100644 index 0000000000000..2bbf692999530 --- /dev/null +++ b/solution/0300-0399/0319.Bulb Switcher/Solution.py @@ -0,0 +1,3 @@ +class Solution: + def bulbSwitch(self, n: int) -> int: + return int(n ** (1 / 2))