Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def middleNode(self, head: ListNode) -> ListNode:
- slow = head
- fast = head
- while fast and fast.next:
- fast = fast.next.next
- slow = slow.next
- return slow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement