1
0
Fork 0
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:
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));
}
}