Skip to content

Commit

Permalink
test: twoSum 두번째 풀이 테스크 코드
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Dec 15, 2023
1 parent 3ead444 commit 571605f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/leetcode/TwoSumTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,22 @@ void twoSumTest() {
int[] result3 = new int[] {0, 1};
Assertions.assertArrayEquals(TwoSum.twoSum(testNum3, target3), result3);
}

@Test
void twoSum2Test() {
int[] testNums1 = new int[] {2,7,11,15};
int target1 = 9;
int[] result1 = new int[] {0, 1};
Assertions.assertArrayEquals(TwoSum.twoSum2(testNums1, target1), result1);

int[] testNum2 = new int[] {3, 2, 4};
int target2 = 6;
int[] result2 = new int[] {1, 2};
Assertions.assertArrayEquals(TwoSum.twoSum2(testNum2, target2), result2);

int[] testNum3 = new int[] {3, 3};
int target3 = 6;
int[] result3 = new int[] {0, 1};
Assertions.assertArrayEquals(TwoSum.twoSum2(testNum3, target3), result3);
}
}

0 comments on commit 571605f

Please sign in to comment.