public static int maxPathSum(TreeNode root) {
    	if (null == root) return 0;
    	List<Integer> max = new ArrayList<Integer>();
    	maxSinglePathSum(root, max);
    	int res = root.val;
    	for (Integer i : max) {
    		if (i > res) res = i;
    	}
    	return res;
    }