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