Nó do meio da lista vinculada

int middleNode(ListNode head) {
    ListNode slow = head
    ListNode fast = head
    while (fast != null and fast.next != null) {
        slow = slow.next
        fast = fast.next.next
    }
    return slow.data
}
Different Dotterel