Python3 代码
class Solution(object):
def printListReversingly(self, head):
"""
:type head: ListNode
:rtype: List[int]
"""
count = 0
curr = head
while curr:
count += 1
curr = curr.next;
l = [0]*count
i = count - 1
while head:
l[i] = head.val
head = head.next
i -= 1
return l