875. 爱吃香蕉的珂珂
小于 1 分钟
875. 爱吃香蕉的珂珂简单
class Solution(object):
def middleNode(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
left = head
right = head
i = 1
while(right.next != None):
if(i):
left = left.next
i -= 1
else:
i += 1
right = right.next
return left
Powered by Waline v2.15.5