problems: add poor pigs

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2022-08-06 20:59:39 +02:00
parent 55ffc32fed
commit aac030d0e2
Signed by: mfocko
GPG key ID: 7C47D46246790496

5
problems/poor-pigs.cs Normal file
View 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));
}
}