forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1066Test.java
More file actions
86 lines (79 loc) · 2.03 KB
/
_1066Test.java
File metadata and controls
86 lines (79 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.fishercoder;
import com.fishercoder.solutions._1066;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class _1066Test {
private static _1066.Solution1 solution1;
private static int[][] workers;
private static int[][] bikes;
@Test
public void test1() {
solution1 = new _1066.Solution1();
workers = new int[][]{
{0, 0},
{2, 1},
};
bikes = new int[][]{
{1, 2},
{3, 3},
};
assertEquals(6, solution1.assignBikes(workers, bikes));
}
@Test
public void test2() {
solution1 = new _1066.Solution1();
workers = new int[][]{
{0, 0},
{1, 1},
{2, 0},
};
bikes = new int[][]{
{1, 0},
{2, 2},
{2, 1},
};
assertEquals(4, solution1.assignBikes(workers, bikes));
}
@Test
public void test3() {
solution1 = new _1066.Solution1();
workers = new int[][]{
{0, 0},
{1, 0},
{2, 0},
{3, 0},
{4, 0},
{5, 0},
};
bikes = new int[][]{
{0, 999},
{1, 999},
{2, 999},
{3, 999},
{4, 999},
{5, 999},
{6, 999},
{7, 999},
};
assertEquals(5994, solution1.assignBikes(workers, bikes));
}
@Test
public void test4() {
solution1 = new _1066.Solution1();
workers = new int[][]{
{815, 60},
{638, 626},
{6, 44},
{103, 90},
{591, 880},
};
bikes = new int[][]{
{709, 161},
{341, 339},
{755, 955},
{172, 27},
{433, 489},
};
assertEquals(1458, solution1.assignBikes(workers, bikes));
}
}