News for hackers. Stuff that matters.
Re:Peter Norvig's “pytudes” for Advent of Code 2020 by Gupie on Friday January 08, 2021 @05:31AM (#25683332)
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.
Re:Peter Norvig's “pytudes” for Advent of Code 2020 by jstanley on Friday January 08, 2021 @08:24AM (#25684439)
Given that the comment says "Find 2 distinct numbers that sum to 2020", I expect duplicate entries are not allowed.
Re:Peter Norvig's “pytudes” for Advent of Code 2020 by Gupie on Friday January 08, 2021 @08:38AM (#25684579)
Yes, 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

Re:Peter Norvig's “pytudes” for Advent of Code 2020 by dubya on Friday January 08, 2021 @10:28PM (#25696304)
There are frequently non-stated properties of the input in Advent of Code that simplify the problem a bit.