if(root.left==null && root.right==null) return 1; 这个是不是可以省略,最后一行也可以换成return true吧。
点赞

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务