You are given an integer n. Your task is to print all the numbers starting from 1 up to n. The solution must be implemented using recursion only, and you are not allowed to use any looping constructs such as for or while.
All the numbers should be printed in increasing order, on a single line, with each number separated by a space.
Example 1
Input: n = 15
Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Explanation: Not Needed
Example 2
Input: n = 5
Output: 1 2 3 4 5
Explanation: Not Needed
Example 3
Input: 2
Output: 1 2
Explanation: Not Needed
Sign in to write, run, and submit your solution against the full test suite.