Created
April 9, 2017 11:44
Revisions
-
linnykoleh created this gist
Apr 9, 2017 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ public ListNode removeElements(ListNode head, int val) { final ListNode fake = new ListNode(-1); fake.next = head; ListNode cur = fake; while(cur.next != null){ if(cur.next.val == val){ cur.next = cur.next.next; }else{ cur = cur.next; } } return fake.next; }