1ms JAVA solution


  • -1
    V

    public class Solution {

    public void deleteNode(ListNode node) {
        while(node.next != null) {
            node.val = node.next.val;
            if(node.next.next != null) {
                node = node.next;
            }
            else {
                node.next = null;
            }
        }
    }
    

    }


Log in to reply
 

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