File tree 3 files changed +6
-6
lines changed
main/java/com/fishercoder/solutions
test/java/com/fishercoder 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ Your ideas/fixes/algorithms are more than welcome!
149
149
| 461| [ Hamming Distance] ( https://leetcode.com/problems/hamming-distance/ ) | [ Solution] ( ../master/src/main/java/com/fishercoder/solutions/HammingDistance.java ) | O(n) | O(1) | Easy|
150
150
|460|[ LFU Cache] ( https://leetcode.com/problems/lfu-cache/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_460.java ) | O(?) |O(?) | Hard| Design
151
151
|459|[ Repeated Substring Pattern] ( https://leetcode.com/problems/repeated-substring-pattern/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_459.java ) | O(n)|O(n) | Easy| KMP
152
- |458|[ Poor Pigs] ( https://leetcode.com/problems/poor-pigs/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/PoorPigs .java ) | O(1) |O(1) | Easy| Math
152
+ |458|[ Poor Pigs] ( https://leetcode.com/problems/poor-pigs/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_458 .java ) | O(1) |O(1) | Easy| Math
153
153
|456|[ 132 Pattern] ( https://leetcode.com/problems/132-pattern/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_456.java ) | O(n) |O(n) | Medium| Stack
154
154
| 455| [ Assign Cookies] ( https://leetcode.com/problems/assign-cookies/ ) | [ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_455.java ) | O(n)| O(1) | Easy|
155
155
|454|[ 4Sum II] ( https://leetcode.com/problems/4sum-ii/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_454.java ) | O(n) |O(n) | Medium| HashMap
Original file line number Diff line number Diff line change 9
9
10
10
If there are n buckets and a pig drinking poison will die within m minutes, how many pigs (x) you need to figure out the "poison" bucket within p minutes? There is exact one bucket with poison.
11
11
*/
12
- public class PoorPigs {
12
+ public class _458 {
13
13
14
14
public int poorPigs (int buckets , int minutesToDie , int minutesToTest ) {
15
15
if (buckets --==1 ){
Original file line number Diff line number Diff line change 1
1
package com .fishercoder ;
2
2
3
- import com .fishercoder .solutions .PoorPigs ;
3
+ import com .fishercoder .solutions ._458 ;
4
4
import org .junit .Before ;
5
5
import org .junit .BeforeClass ;
6
6
import org .junit .Test ;
7
7
8
8
import static junit .framework .Assert .assertEquals ;
9
9
10
- public class PoorPigsTest {
11
- private static PoorPigs test ;
10
+ public class _458Test {
11
+ private static _458 test ;
12
12
private static int expected ;
13
13
private static int actual ;
14
14
private static int buckets ;
@@ -17,7 +17,7 @@ public class PoorPigsTest {
17
17
18
18
@ BeforeClass
19
19
public static void setup (){
20
- test = new PoorPigs ();
20
+ test = new _458 ();
21
21
}
22
22
23
23
@ Before
You can’t perform that action at this time.
0 commit comments