We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
原题链接
constpreorder=function(root){if(root===null)return[]constres=[]functiondfs(root){if(root===null)returnres.push(root.val)for(leti=0;i<root.children.length;i++){dfs(root.children[i])}}dfs(root)returnres}