HashedIn by Deloitte Interview Question

Write code to findPath from root to leaf node whose sum is equal to given number