src/main/java/com/leetcode/design/medium/DesignLinkedList_707.java
public void deleteAtIndex(int index) {
    Node node = head;

    if (index == 0) {
      head = head.next;
      return;
    }

    while (index-- > 1 && node != null) {
      node = node.next;
    }

    if (node != null && node.next != null) {
      node.next = node.next.next;
    }
  }
/** Delete the index-th node in the linked list, if the index is valid. */
Delete the index-th node in the linked list, if the index is valid.
Delete the index - th node in the linked list if the index is valid .
public void deleteAtIndex(int index) {
    Node node = head;
    if (index == 0) {
      head = head.next;
      return;
    }
    while (index-- > 1 && node != null) {
      node = node.next;
    }
    if (node != null && node.next != null) {
      node.next = node.next.next;
    }
  }
public void deleteAtIndex ( int index ) { Node node = head ; if ( index == 0 ) { head = head . next ; return ; } while ( index -- > 1 && node != null ) { node = node . next ; } if ( node != null && node . next != null ) { node . next = node . next . next ; } }
Delete the index-th node in the linked list, if the index is valid.
Delete the index - th node in the linked list if the index is valid .