As reported: Cisco, networking/C-focused role, round 1 DSA part (2026): find the middle of a singly linked list.
Given the head of a singly linked list, return its middle node. If there are two middle nodes, return the second one.
This is LeetCode 876 — Middle of the Linked List.
Example 1
head = [1,2,3,4,5] -> [3,4,5] (the list from the middle node on)
Example 2
head = [1,2,3,4,5,6] -> [4,5,6]
Constraints: 1 ≤ length ≤ 100; 1 ≤ Node.val ≤ 100.
Code runner format: one line, the list as a JSON array. Implement middleNode(head); the harness prints the list starting at the returned node.