From 273b77cded4cf7c728fcb806fd31e519703cd655 Mon Sep 17 00:00:00 2001 From: dmswl6310 Date: Sun, 6 Sep 2026 16:12:50 +0900 Subject: [PATCH] 0906 --- .../834. Sum of Distances in Tree.js" | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 "leetcode3/\355\231\251\354\235\200\354\247\200/834. Sum of Distances in Tree.js" diff --git "a/leetcode3/\355\231\251\354\235\200\354\247\200/834. Sum of Distances in Tree.js" "b/leetcode3/\355\231\251\354\235\200\354\247\200/834. Sum of Distances in Tree.js" new file mode 100644 index 00000000..4f2cc5d3 --- /dev/null +++ "b/leetcode3/\355\231\251\354\235\200\354\247\200/834. Sum of Distances in Tree.js" @@ -0,0 +1,11 @@ +/** + * @param {number} n + * @param {number[][]} edges + * @return {number[]} + */ +var sumOfDistancesInTree = function (n, edges) { + const dp = Array.from({ length: 6 }, () => Array(6)); + // 미리 2차원 배열에 채운다 + // root에서 내려가면서 한번만 계산하는 방법이 없을까? + // dfs n번 돌리니 시간초과됨.. dp를 써야될거같은데 방법을 못찾음.. +};