You are given the head of a linked list. Delete the middle node, and return the head of the modified linked list.
Example :
Input: head = [1,2,3,4]
Output: [1,2,4]
Explanation:
The figure represents the given linked list.
For n = 4, node 2 with value 3 is the middle node, which is marked in red.
Description
Delete the Middle Node of a Linked List
You are given the head of a linked list. Delete the middle node, and return the head of the modified linked list. Example :
Input: head = [1,2,3,4] Output: [1,2,4] Explanation: The figure represents the given linked list. For n = 4, node 2 with value 3 is the middle node, which is marked in red.
Code of Conduct