Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfccda5e

Browse files
fix tests
1 parent81dacbe commitfccda5e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎src/main/java/com/fishercoder/solutions/_86.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public ListNode partition(ListNode head, int x) {
4545
}
4646
ListNodepre =newListNode(-1);
4747
ListNodetmp =pre;
48-
inti =1;
48+
inti =0;
4949
intj =0;
5050
while (i <first.size() ||j <last.size()) {
5151
if (i <first.size()) {

‎src/test/java/com/fishercoder/_86Test.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public void test1() {
2727
head =LinkedListUtils.createSinglyLinkedList(Arrays.asList(1,4,3,2,5,2));
2828
expected =LinkedListUtils.createSinglyLinkedList(Arrays.asList(1,2,2,4,3,5));
2929
assertEquals(expected, (solution1.partition(head,3)));
30+
}
31+
32+
@Test
33+
publicvoidtest2() {
34+
head =LinkedListUtils.createSinglyLinkedList(Arrays.asList(1,4,3,2,5,2));
35+
expected =LinkedListUtils.createSinglyLinkedList(Arrays.asList(1,2,2,4,3,5));
3036
assertEquals(expected, (solution2.partition(head,3)));
3137
}
3238

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp