@@ -0,0 +1,590 @@
+package removeLinkedListElement;%0A%0Aclass ListNode %7B%0A    int val;%0A    ListNode next;%0A    ListNode(int x) %7B val = x; %7D%0A%7D%0A%0Apublic class Solution %7B%0A    public ListNode removeElements(ListNode head, int val) %7B%0A        ListNode prehead = new ListNode(1);%0A        prehead.next = head;%0A        ListNode p = prehead;%0A        while(p.next != null)%7B%0A            if(p.next.val == val)%7B%0A                ListNode temp = p.next;%0A                p.next = temp.next;%0A                temp.next = null;%0A            %7Delse%7B%0A                p = p.next;%0A            %7D%0A        %7D%0A        return prehead.next;%0A    %7D%0A%7D

remove linkedlist element