We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Yes that was my solution, except in C++. Recursion has its place, but if you aren't darned sure of the depth, it's smart to build in a counter and bail after a certain length to avoid stack overflow,
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Print in Reverse
You are viewing a single comment's thread. Return to all comments →
Yes that was my solution, except in C++. Recursion has its place, but if you aren't darned sure of the depth, it's smart to build in a counter and bail after a certain length to avoid stack overflow,