class Solution:
def reversePrint(self, head: ListNode) -> List[int]:
if not head:
return []
ans=[]
while(head):
ans.insert(0,head.val)
head=head.next
return ans
12-30