Question is very simple we have check whether there is root to leaf path with its sum equal to S(sum given to find).
task: Complete the function hasPathSum() which takes