Welcome to my personal website. I use this space to share some of my thoughts and software that I write in my free time. Sometimes I also publish photos. If you want to get in touch please use LinkedIn or Mastodon.
Given a binary tree, check if there’s a path such that a targetSum can be reached. A target sum is the sum of values of all visited nodes along the path.
This again can be solved well via recursion. The “trick” is to adapt the targetSum and check at each level. If the tree is empty or if we reach beyond a leaf node, the targetSum cannot be reached.
About the author
Friedrich Ewald is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.