Middle of the Linked List LeetCode solution in Python

1
class Solution:
2
def middleNode(self, head):
3
Iter, N = head, 0
4
while Iter:
5
Iter, N = Iter.next, N + 1
6
for i in range(N // 2):
7
head = head.next
8
return head

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0