GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Leetcode-Java/leetcode/solution/src/PathSum.java at master · Tulpen/Leetcode-Java Expand file tree/ Copy pathPathSum.javaMore file actions 13 lines (12 loc) · 352 Bytes / Copy pathPathSum.javaFile metadata and controls13 lines (12 loc) · 352 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 public class PathSum { public boolean hasPathSum(TreeNode root, int sum) { if (root == null) { return false; } if (root.left == null && root.right == null) { return root.val == sum; } sum -= root.val; return hasPathSum(root.left, sum) || hasPathSum(root.right, sum); } } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |