File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 458. Poor Pigs
5
- *
6
- * There are 1000 buckets, one and only one of them contains poison,
7
- * the rest are filled with water.
8
- * They all look the same.
9
- * If a pig drinks that poison it will die within 15 minutes.
10
- * What is the minimum amount of pigs you need to figure out which bucket contains the poison within one hour.
11
- * Answer this question, and write an algorithm for the follow-up general case.
12
-
13
- Follow-up:
14
- If there are n buckets and a pig drinking poison will die within m minutes,
15
- how many pigs (x) you need to figure out the "poison" bucket within p minutes? There is exact one bucket with poison.
16
-
17
- */
18
3
public class _458 {
19
4
20
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments