
[LeetCode] 2095. Delete the Middle Node of a Linked List, Medium
·
CodingTest/LeetCode
1. 문제연결 리스트가 주어질 때, 중간 노드를 제외한 리스트를 반환하라.중간 노드는 전체 길이 n/2 위치한다.2. 해결/** * Definition for singly-linked list. * class ListNode { * val: number * next: ListNode | null * constructor(val?: number, next?: ListNode | null) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } * } */function deleteMiddle(head: ListNode | null): Li..