Marks :10
: 0 | : 0
Given an integer array, $$$A$$$ of length $$$N$$$ and the sum of the elements of this array is $$$X$$$. You are also given an integer array $$$B$$$ of length $$$N$$$ which is given as $$$B_{i} = X - A_{i}$$$ for all $$$ 0 \le i \le N-1$$$. Your task is to find Array $$$A$$$.
The first line contains an integer $$$N$$$. The next line contains an array $$$B$$$ having $$$N$$$ elements where $$$B_{i} = X - A_{i}$$$ for all $$$ 0 \le i \le N-1$$$.$$$(2 \le N \le 10^5)$$$$$$(0 \le B_{i} \le 10^5).$$$
Output the integer array $$$A$$$.
3 1 3 4
3 1 0
5 25539 29221 6895 82089 0
10397 6715 29041 -46153 35936
For a given array $$$B_{i}$$$, there will always be an array $$$A_{i}.$$$
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.