# GTHER – EDITORIAL

**Author:** bigo_admin

**Tester and Editorialist:** tejaram15

**Problrm Links:-** Contest

and Practice

### DIFFICULTY:

CAKEWALK### PREREQUISITES:

Array### PROBLEM:

Given an array of integers**[A**you need to find sum of all other indices of the given array excluding the current one.

_{1},A_{2},…A_{n}]### EXPLANATION:

Simply think that you need to find the number of candies that all other students have in your class the there are two different approaches…#include "stdio.h" int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); int a[n+1]; long int sum=0; for(int i=0;i<n;i++) scanf("%d",&a[i]),sum+=a[i]; for(int i=0;i<n;i++) (i==n-1)?printf("%ld\n",sum-a[i]):printf("%ld ",sum-a[i]); } return 0; }