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 9d03c3d commit 66f27da
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 @@ -41,4 +41,22 @@ void twoSum2Test() {
int[] result3 = new int[] {0, 1};
Assertions.assertArrayEquals(TwoSum.twoSum2(testNum3, target3), result3);
}

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

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

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

0 comments on commit 66f27da

Please sign in to comment.