Print N to 1 using Recursion Intro 4
Easy

Problem Statement

Write a recursive function to print numbers from a given integer N down to 1.

Examples

1Example 1
Input:
{ "n": 5 }
Output:
[ 5, 4, 3, 2, 1 ]
2Example 2
Input:
{ "n": 10 }
Output:
[ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
3Example 3
Input:
{ "n": 1 }
Output:
[ 1 ]
Loading...

Sign in to Run Code and Submit