二叉树 这样子写ok吗 function isFind(root){ let result = false; let sum = 0 if(root){ sum += root.val; if(sum === 22){ return true; } root.left && isFind(root.left); root.right && isFind(root.right); } return result; }
点赞 评论

相关推荐

迷茫的大四🐶:我不许你接受,我不许你启动咏鹅
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务