For this Question: Given a Binary Tree,  your task is to compute the sum of all leaf nodes in the tree.

Note :- All the nodes in the tree are distinct .<b>User Task:</b>
Since this will be a functional problem. You don't have to take input. You just have to complete the function <b>sumOfLeaf()</b> that takes "root" node as parameter.

Constraints:
1 <= T <= 100
1 <= N <= 10^5
1 <= node values <= 10^5

Sum of "N" over all test cases does not exceed 2*10^5

For <b>Custom Input:</b>
First line of input should contains the number of test cases T. For each test case, there will be two lines of input.
First line contains number of nodes N and the required sum X. Second line will be a string representing the tree as described below: 
The values in the string are in the order of level order traversal of the tree where, numbers denote node values, and a character “N” denotes NULL child.
<b>Note:</b> If a node has been declared Null using 'N', no information about its children will be given further in the array.Return the sum of all the leaf nodes of the binary tree.Sample Input:
2
3
10 8 34 
2
48 36

Sample Output:
42
36, I have written this Solution Code: 
static class Res
{
    int sum = 0;
}

public static int sumOfLeaf(Node root)
    {
        Res r = new Res();
        leafSum(root, r);
        return r.sum;
    }

    public static void leafSum(Node root, Res r)
    {
        if(root == null)
            return;

        if(root.left == null && root.right == null)
            r.sum += root.data;

        leafSum(root.left, r);
        leafSum(root.right, r);
    }, In this Programming Language: Java, Now tell me if this Code is compilable or not?