mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-06 09:23:19 +08:00
9 lines
226 B
Go
9 lines
226 B
Go
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))))
|
|
}
|