From a52a93436fd5ae4d837e42cb2e0afb76c6f1d6ad Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Thu, 1 Dec 2022 12:45:04 -0800 Subject: [PATCH] shrink the vec in remove vec --- remove_nth_from_list_end/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/remove_nth_from_list_end/src/main.rs b/remove_nth_from_list_end/src/main.rs index 2e3cf47..2ac704e 100644 --- a/remove_nth_from_list_end/src/main.rs +++ b/remove_nth_from_list_end/src/main.rs @@ -36,6 +36,7 @@ impl Solution { v.push(node.val); list = node.next; } + v.shrink_to_fit(); v } }