Skip to content

sumoftheothers

bradendubois edited this page Nov 24, 2021 · 9 revisions

Sum of the Others

ID: sumoftheothers

Difficulty: 2.2

CPU Time: 1 second

Memory: 1024 MB

Solution

For each test case, since one number is equal to the sum of all the others, one can sum up every value in the list (and store them), and then go through each number in the list, and see if that sum, minus this value, is equivalent to this number; if so, output it and move on to the next case.

Clone this wiki locally