## Solutions ### slow and fast pointers ```python # Definition for singly-linked list. # class ListNode(object): # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution(object): def middleNode(self, head): """ :type head: Optional[ListNode] :rtype: Optional[ListNode] """ fast = head slow = head while fast and fast.next: slow = slow.next fast = fast.next.next return slow ``` #### Complexity Analysis - Time complexity is On, because we use a while loop - Space complexity is O1, because we only declare 2 pointers