SSS: Swift Simple Solution ★★
Approach\nTwo pointers: fast and slow\n\n# Complexity\n- Time complexity: O(N)\n- Space complexity: O(1)\n\n# Code\n\nOrdinary way\n\n\nfunc middleNode(_ head: 
# Approach\nTwo pointers: fast and slow\n\n# Complexity\n- Time complexity: $$O(N)$$\n- Space complexity: $$O(1)$$\n\n# Code\n\n**Ordinary way**\n\n```\nfunc middleNode(_ head: ListNode?) -> ListNode? {\n\tvar slow = head, fast = head\n    while let node = fast?.next {\n        slow = slow?.next\n        fast = node.next\n    }\n    return slow\n}\n```\n\n**Animals way**\n\n```\nfunc middleNode(_ head: ListNode?) -> ListNode? {\n    var turtle = head, rabbit = head\n    while rabbit?.next != nil {\n        turtle = turtle?.next\n        rabbit = rabbit?.next?.next\n    }\n    return turtle\n}\n```\n\nor (yep \uD83D\uDE00 it\'s valid code)\n\n```\nfunc middleNode(_ head: ListNode?) -> ListNode? {\n    var (\uD83D\uDC22, \uD83D\uDC07) = (head, head)\n    while \uD83D\uDC07?.next != nil {\n        \uD83D\uDC22 = \uD83D\uDC22?.next\n        \uD83D\uDC07 = \uD83D\uDC07?.next?.next\n    }\n    return \uD83D\uDC22\n}\n```
['Two Pointers', 'Swift']