没什么难度。
class Solution { public ListNode deleteNode(ListNode head, int val) { ListNode dump = new ListNode(-1); dump.next = head; ListNode pre = dump; while (head != null){ if(head.val == val){ pre.next = head.next; return dump.next; }else{ head = head.next; pre = pre.next; } } return dump.next; } }