https://github.com/letsdeepchat/hrecurs---hello-recursion
https://github.com/letsdeepchat/hrecurs---hello-recursion
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/letsdeepchat/hrecurs---hello-recursion
- Owner: letsdeepchat
- Created: 2021-12-26T16:09:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-26T16:11:25.000Z (over 4 years ago)
- Last Synced: 2025-04-06T09:52:54.130Z (12 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HRECURS---Hello-Recursion
HRECURS - Hello Recursion
You will be given an array of N integers. Write a recursive function to calculate its summation.
####Input
Input starts with an integer T (T ≤ 100), the number of test cases.
Each of the next T lines will start with an integer N (1 <= N <= 100), number of integers followed by N space separated. Each of these N integers will be between -1000 and 1000 (inclusive).
####Output For each test case, output one line in the format “Case x: a” (quotes for clarity), where x is the case number and a is the summation of the integers.
Sample Input
Input:
2
5 10 5 -2 3 0
3 100 -10 34
Sample Output
Output:
Case 1: 16
Case 2: 124
Explanation
You just have to get the sum, which is an easy in task iteratively. Try it recursively.