We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1aa3025 commit e9ab17eCopy full SHA for e9ab17e
remove-linked-list-elements/README.md
remove-linked-list-elements/Solution.java
@@ -0,0 +1,20 @@
1
+/**
2
+ * Definition for singly-linked list.
3
+ * public class ListNode {
4
+ * int val;
5
+ * ListNode next;
6
+ * ListNode(int x) { val = x; }
7
+ * }
8
+ */
9
+public class Solution {
10
+ public ListNode removeElements(ListNode head, int val) {
11
+
12
+ if(head == null) return null;
13
14
+ if(head.val == val) return removeElements(head.next, val);
15
16
+ head.next = removeElements(head.next, val);
17
18
+ return head;
19
+ }
20
+}
remove-linked-list-elements/index.md
@@ -0,0 +1,7 @@
+---
+layout: solution
+title: Remove Linked List Elements
+date: 2015-04-23 11:38:34+08:00
+leetcode_id: 203
+{% include_relative README.md %}
0 commit comments