Simple 1ms Java Solution


  • -2
    public void deleteNode(ListNode node) {
        node.val ^= node.next.val;
        node.next.val ^= node.val;
        node.val ^= node.next.val;
        node.next = node.next.next!=null?node.next.next:null;
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.