MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / sumNumbers

Method sumNumbers

Java/sum-root-to-leaf-numbers.java:23–26  ·  view source on GitHub ↗
(TreeNode root)

Source from the content-addressed store, hash-verified

21 int sum = 0;
22
23 public int sumNumbers(TreeNode root) {
24 traverse(root, 0);
25 return sum;
26 }
27
28 public void traverse(TreeNode root, int n) {
29 // if the node is null, return from the function (specially to handle if root of

Callers

nothing calls this directly

Calls 1

traverseMethod · 0.95

Tested by

no test coverage detected