Middle node
Write middle(head) that returns the middle node of a linked list. When
the list has an even number of nodes, return the second of the two middle
nodes. The list has at least one node.
middle(1 -> 2 -> 3 -> 4 -> 5) -> the node 3 (shown as 3 -> 4 -> 5)
middle(1 -> 2 -> 3 -> 4) -> the node 3 (shown as 3 -> 4)
The point is to practise fast and slow pointers, so find it in one pass without counting the length first.
def middle(head):
...