A Very Big Sum - Hackerrank Solution

 

A Very Big Sum


In this challenge, you are required to calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large.


Function Description

Complete the aVeryBigSum function in the editor below. It must return the sum of all array elements.

aVeryBigSum has the following parameter(s):

int ar[n]: an array of integers .


Return

long: the sum of all array elements


Solution:

n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
res = sum(arr)
print(res)


Note:

This Code is Verified by all Test Cases.If any error occurs then Comment correct code Below in comment box.

Disclaimer:-

The above hole problem statement is given by hackerrank.com, but the solution is generated by the CodexRitik . if any of the query regarding this post or website fill the following contact form Thank You.

A Very Big Sum - Hackerrank Solution A Very Big Sum - Hackerrank Solution Reviewed by CodexRitik on January 03, 2021 Rating: 5

No comments:

Powered by Blogger.