Convert Digits to Strings
Learn to use Recursion to solve coding problems.
We'll cover the following
Problem statement
*Given a number n
, convert each digit of that number to its corresponding string. Make sure the order is correct.
For example, let us take n = 278. The output should be two seven eight.
Solution: Recursive approach
The problem looks very easy and it could have been implemented without using Recursion. But to understand the concept of Recursion, it is very important that we discuss some basic problems too.
Let us first visualize how Recursion might help in solving this problem.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.