|
3 | 3 | import static org.hamcrest.CoreMatchers.equalTo;
|
4 | 4 | import static org.hamcrest.MatcherAssert.assertThat;
|
5 | 5 |
|
6 | | -import java.util.ArrayList; |
7 | | -import java.util.Arrays; |
8 | | -import java.util.List; |
| 6 | +import com_github_leetcode.ArrayUtils; |
9 | 7 | import org.junit.Test;
|
10 | 8 |
|
11 | 9 | public class SolutionTest {
|
12 | 10 | @Test
|
13 | | - public void triangle() { |
14 | | - List<List<Integer>> input = new ArrayList<>(); |
15 | | - input.add(Arrays.asList(2)); |
16 | | - input.add(Arrays.asList(3, 4)); |
17 | | - input.add(Arrays.asList(6, 5, 7)); |
18 | | - input.add(Arrays.asList(4, 1, 8, 3)); |
19 | | - |
20 | | - assertThat(new Solution().minimumTotal(input), equalTo(11)); |
| 11 | + public void minimumTotal() { |
| 12 | + assertThat( |
| 13 | + new Solution() |
| 14 | + .minimumTotal( |
| 15 | + ArrayUtils.getLists( |
| 16 | + new int[][] {{2}, {3, 4}, {6, 5, 7}, {4, 1, 8, 3}})), |
| 17 | + equalTo(11)); |
21 | 18 | }
|
22 | 19 | }
|
0 commit comments