Marks :10
: 3 | : 0
You are given an integer array $$$A$$$ containing $$$N$$$ integers. You will perform the following operation on this array until there are no more elements left in the array.
Your task is to find the total score after you delete the entire array.
The first line of input contains an integer $$$t \hspace{2pt} (1 \le t \le 10^4)$$$ — the number of testcases. The description of $$$t$$$ testcases follows.
The first line of each testcase contains an integer $$$n \hspace{2pt} (1 \le n \le 10^5)$$$ — the number of elements in the array $$$A$$$.
The second line of each testcase contains $$$n$$$ space separated integers $$$a_0, a_1, ... a_n$$$ $$$(0 \le a_i \le 10^9)$$$ — the elements of array $$$A$$$.
It is guaranteed that the sum of $$$n$$$ over all testcases does not exceed $$$10^5.$$$
For each testcase, print a single integer — the total score after deleting the entire array $$$A$$$.
244 3 2 176 4 9 10 34 56 54
4 68
In sample test case 1, you perform the following operations:
Hence,the total is $$$1+3=4.$$$
In sample test case 2, you perform the following operations:
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.