[Java] Runtime: 0ms, faster than 100% || Memory usage less than 93.97%
\nclass Solution {\n    public ListNode middleNode(ListNode head) {\n        if (head == null || head.next == null) return head;\n\n        ListNode slow = head
```\nclass Solution {\n    public ListNode middleNode(ListNode head) {\n        if (head == null || head.next == null) return head;\n\n        ListNode slow = head;\n        ListNode fast = head;\n\n        while (fast != null && fast.next != null) {\n            slow = slow.next;\n            fast = fast.next.next;\n        }\n        return slow;\n    }\n}\n```\n\n![image](https://assets.leetcode.com/users/images/5baac6a7-a39d-4ca6-b6cf-4043b2fec6b9_1667271776.9770112.png)\n
['Java']