public boolean hasPathSum(TreeNode root, int sum) {
		if(root == null) return false;
		if(root.left == null && root.right == null) return sum == root.val; // I wrote sum == 0 in 1st try :(
		if(root.left != null && hasPathSum(root.left, sum - root.val)) return true;
		else return root.right != null && hasPathSum(root.right, sum - root.val);
	}