1var postorder = function (root) {2 const res = [];3 function post(node) {4 if (!node) return;5 for (let child of node.children) {6 post(child);7 }8 res.push(node.val);9 }10 post(root);11 return res;12};
WPM •0 •0
ACC •0 •0
TIME •0