Sum of the Others — Solution & Editorial
Compute the total once; each output is total − ai.
Complexity: O(N)
Watch out: The total needs 64 bits at full constraints.
Compute the total once; each output is total − ai.
Complexity: O(N)
Watch out: The total needs 64 bits at full constraints.