public int sumNumbers(TreeNode root) {
		int sum = 0;
		if (root == null)
			return sum;
		Stack<TreeNode> sta = new Stack<TreeNode>();
		// sta.push(root);
		TreeNode p = root;
		while (p != null || !sta.empty()) {

			while (p != null) {
				sta.push(p);
				p = p.left;
			}
			if (!sta.empty()) {
				p = sta.pop();
				p=p.right;
				if(p==null) {
					
					int temp = 0;
					TreeNode t;
					for(TreeNode node:sta){
						temp=temp*10+node.val;
					}

					sum += temp;
					// read stack and
					//sta.pop(); // stack pop()

				}

			}
		}
		return sum;
	}