Description: You are given an array of integers. Your task is to print all the elements of the array using recursion only. You are not allowed to use any loops such as for or while
Examples
Example 1
Example 1
Input: arr[] = [1,2,3.4,5]
Output: 1 2 3 4 5
Explanation: No Need
Example 2
Example 2
Input: arr[] = [7,4,1,8,5]
Output: 7 4 1 8 5
Explanation: No Need
Hints
Hint 1
N/A
Constraints
Constraints: 1 < n < 105
-109 < arr[i] < 109
Companies
AppleSamsungMastercardMedia.net
Topics
Recursion
Track your submissions
Please log in to review your progress and explore code submissions from other participants.
Unlock the full solution
Please log in to access detailed answers and explanations.
Join the discussion
Please log in to join conversations with other participants.
Solution.csC#JavaPythonC++Javascript
1
2
3
4
5
6
7
8
9
10
Unlock the code editor
Sign in to write, run, and submit your solution against the full test suite.