Skip to content

Commit 1c72f84

Browse files
refactor 19
1 parent 00009d9 commit 1c72f84

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.common.classes.ListNode;
4+
import com.fishercoder.common.utils.LinkedListUtils;
5+
import com.fishercoder.solutions._19;
6+
import org.junit.BeforeClass;
7+
import org.junit.Test;
8+
9+
import static org.junit.Assert.assertEquals;
10+
11+
public class _19Test {
12+
private static _19.Solution1 solution1;
13+
private static ListNode head;
14+
private static ListNode expected;
15+
16+
@BeforeClass
17+
public static void setup() {
18+
solution1 = new _19.Solution1();
19+
}
20+
21+
@Test
22+
public void test1() {
23+
head = LinkedListUtils.contructLinkedList(new int[]{1, 2, 3, 4, 5});
24+
expected = LinkedListUtils.contructLinkedList(new int[]{1, 2, 3, 5});
25+
assertEquals(expected, solution1.removeNthFromEnd(head, 2));
26+
}
27+
28+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy