Skip to content

Commit d06ed38

Browse files
committed
Runtime: 110 ms (Top 30.61%) | Memory: 44.3 MB (Top 44.87%)
1 parent c934289 commit d06ed38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
// Runtime: 110 ms (Top 30.61%) | Memory: 44.3 MB (Top 44.87%)
12
var levelOrderBottom = function(root) {
23
let solution = []
34
function dfs(node, level) {
45
if(!node) return null
5-
6+
67
if(!solution[level]) solution[level] = []
78
solution[level].push(node.val)
89

@@ -11,4 +12,4 @@ var levelOrderBottom = function(root) {
1112
}
1213
dfs(root, 0)
1314
return solution.reverse()
14-
};
15+
};

0 commit comments

Comments
 (0)