4 ms·
The "x == y" test looks like a bug to me, unless duplicate entries are not allowed. For example [1010,1010,1721,979,366,299,675,1456] should return 1010 * 1010,
by Gupie 6y ago
The "x == y" test looks like a bug to me, unless duplicate entries are not allowed. For example [1010,1010,1721,979,366,299,675,1456] should return 1010 * 1010, not 1721 * 299.
- deleted 6y ago[deleted]
- jstanley 6y agoGiven that the comment says "Find 2 distinct numbers that sum to 2020", I expect duplicate entries are not allowed.
- Gupie 6y agoYes, but I cannot find the same in the problem definition: "they need you to find the two entries that sum to 2020 and then multiply those two numbers together" https://adventofcode.com/2020/day/1 https://adventofcode.com/2020/day/1
- dubya 6y agoThere are frequently non-stated properties of the input in Advent of Code that simplify the problem a bit.