add: leetcode 0458 solution

This commit is contained in:
tphyhFighting
2021-11-25 11:55:09 +08:00
parent f0792d1179
commit 04ead8d3f3

View File

@ -0,0 +1,8 @@
package leetcode
import "math"
func poorPigs(buckets int, minutesToDie int, minutesToTest int) int {
base := minutesToTest/minutesToDie + 1
return int(math.Ceil(math.Log10(float64(buckets)) / math.Log10(float64(base))))
}