From b1b50944360a8a4c3d0d71571820e7d025ca2881 Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Tue, 29 Nov 2022 23:11:54 +0800 Subject: [PATCH] Update linkedlist_stack.py --- codes/python/chapter_stack_and_queue/linkedlist_stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/python/chapter_stack_and_queue/linkedlist_stack.py b/codes/python/chapter_stack_and_queue/linkedlist_stack.py index 88029474d..19ffdc39a 100644 --- a/codes/python/chapter_stack_and_queue/linkedlist_stack.py +++ b/codes/python/chapter_stack_and_queue/linkedlist_stack.py @@ -52,7 +52,7 @@ class LinkedListStack: while temp: stack.append(temp.val) temp = temp.next - stack = stack[::-1] + stack.reverse() return stack