Skip to content

203. Remove Linked List Elements #70

@jzhangnu

Description

@jzhangnu
    var node = new ListNode(0);

    var prev =node;
    node.next = head;

    while(head != null){
        if(head.val != val){
            prev = head;
            head = head.next;
        } else {
            prev.next = head.next;
            head = head.next;           
        }

    }

    return node.next;
};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions