East to understand c++ solution


#1
# define m 1003
void sol(TreeNode *A, int &sum,int ans){
    ans = (10*ans%m+A->val)%m;
    if(!A->left && !A->right){
        sum=sum + ans;
        sum=sum%m;
        return;
    }
    if(A->left)sol(A->left,sum,ans);
    if(A->right)sol(A->right,sum,ans);
}
int Solution::sumNumbers(TreeNode* A) {
    if(A==NULL)return 0;
    int sum=0;
    sol(A,sum,0);
    return sum%m;
}