Sum of Series
Problem Statement
Write a program to find the sum of the given series 1+2+3+ . . . . . .(N terms).
Example 1
Example 2
Task
Complete the function seriesSum() which takes single integer n, as input parameters and returns an integer denoting the answer. You don't need to print the answer or take inputs.
Expected Time Complexity : O(1)
Expected Auxiliary Space : O(1)
Constraints :
1 <= N <= 105
0 Comments