mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-09 15:59:06 +01:00
problems: add poor pigs
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
55ffc32fed
commit
aac030d0e2
1 changed files with 5 additions and 0 deletions
5
problems/poor-pigs.cs
Normal file
5
problems/poor-pigs.cs
Normal file
|
@ -0,0 +1,5 @@
|
|||
public class Solution {
|
||||
public int PoorPigs(int buckets, int minutesToDie, int minutesToTest) {
|
||||
return (int) Math.Ceiling(Math.Log(buckets) / Math.Log(1 + minutesToTest / minutesToDie));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue