Solution to find all paths in a tree with given sum