Appearance
2095. 删除链表的中间节点
题解代码
javascript
var deleteMiddle = function(head) {
if (!head.next) return null
let slow = head, fast = head.next
while (fast && fast.next && fast.next.next) {
slow = slow.next
fast = fast.next.next
}
slow.next = slow.next.next
return head
};