HashedIn by Deloitte interview question

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