mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-07 09:54:57 +08:00
Update solution 0319
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
# [319. Bulb Switcher](https://leetcode-cn.com/problems/bulb-switcher/)
|
# [319. Bulb Switcher](https://leetcode.com/problems/bulb-switcher/)
|
||||||
|
|
||||||
|
|
||||||
## 题目
|
## 题目
|
||||||
@ -46,6 +46,7 @@ Return the number of bulbs that are on after n rounds.
|
|||||||
## 代码
|
## 代码
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
||||||
package leetcode
|
package leetcode
|
||||||
|
|
||||||
import "math"
|
import "math"
|
||||||
@ -53,4 +54,5 @@ import "math"
|
|||||||
func bulbSwitch(n int) int {
|
func bulbSwitch(n int) int {
|
||||||
return int(math.Sqrt(float64(n)))
|
return int(math.Sqrt(float64(n)))
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
Reference in New Issue
Block a user