From 81e202dab9acadafde294cce962a02fc905029ad Mon Sep 17 00:00:00 2001 From: JEONGHWANMIN Date: Sun, 18 Aug 2024 11:16:30 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20sort=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kth-smallest-element-in-a-bst/hwanminini.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kth-smallest-element-in-a-bst/hwanminini.js b/kth-smallest-element-in-a-bst/hwanminini.js index bf2021949..f34183f81 100644 --- a/kth-smallest-element-in-a-bst/hwanminini.js +++ b/kth-smallest-element-in-a-bst/hwanminini.js @@ -25,5 +25,7 @@ var kthSmallest = function(root, k) { dfs(root) + results.sort((a,b) => a - b) + return results[k-1] };