Challenge for Basic Recursion
You will be given a positive integer
a. Fill in the method
doStuff so that it adds up all the positive integers up to
a and returns the sum. For example, when given
4 it should return
While there are other ways to solve this challenge, you should use recursion to get the sum.
(Raw Input Note: The first line contains N, the number of cases, and N lines follow, which each contain a single integer.)
Alternatively, you can try out Learneroo before signing up.