hasPathSum = function(root, targetSum) {

  if(root==null){
    return false
  }
  if(!root.left && !root.right){
    return root.val ===targetSum
  }
  let offset = targetSum - root.val
  return hasPathSum(root.left,offset) || hasPathSum(root.right,offset)
}
@param {TreeNode} root
@param {number} targetSum
@return {boolean}