Please enter your email address or userHandle.
Given an array of N integers. Your task is to print the sum of all of the integers.
1 2 3 4
5 8 3 10 22 45
You don't need to read input or print anything. Your task is to complete the function getSum() which takes the array A and its size N as inputs and returns the sum of array in a new line.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
1 ≤ N ≤ 106
0 ≤ Arr[i] ≤ 200
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.