class Solution:
def FindKthToTail(self, head, k):
# write code here
if head is None:
return None
first = head
second = head
for _ in range(k):
if first == None:
return None
first = first.next
while first != None:
first = first.next
second = second.next
return second
网友评论