-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8be01e9
commit f45bfec
Showing
1 changed file
with
5 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,22 @@ | ||
package com.fishercoder.firstthousand; | ||
|
||
import com.fishercoder.solutions.firstthousand._985; | ||
import com.fishercoder.solutions.firstthousand._351; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class _351Test { | ||
private static _985.Solution1 solution1; | ||
private static int[] expected; | ||
private static int[] actual; | ||
private static int[] A; | ||
private static int[][] queries; | ||
private static _351.Solution1 solution1; | ||
|
||
@BeforeEach | ||
public void setup() { | ||
solution1 = new _985.Solution1(); | ||
solution1 = new _351.Solution1(); | ||
} | ||
|
||
@Test | ||
public void test1() { | ||
A = new int[]{1, 2, 3, 4}; | ||
queries = new int[][]{{1, 0}, {-3, 1}, {-4, 0}, {2, 3}}; | ||
expected = new int[]{8, 6, 2, 4}; | ||
actual = solution1.sumEvenAfterQueries(A, queries); | ||
assertArrayEquals(expected, actual); | ||
assertEquals(9, solution1.numberOfPatterns(1, 1)); | ||
} | ||
} |