Skip to content

Commit 65e3c5b

Browse files
authored
Create Poor Pigs
1 parent a608b72 commit 65e3c5b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Poor Pigs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
3+
int T = minutesToTest/minutesToDie;
4+
return (int)Math.ceil(Math.log(buckets) / Math.log(T + 1));
5+
}
6+
}

0 commit comments

Comments
 (0)