News for hackers. Stuff that matters.
Re:The World Excel Championship is being broadcast on ESPN by robbie-c on Thursday August 11, 2022 @09:45AM (#32425449)
I just looked at this for 30 seconds, do you just XOR everything together? Then you could XOR it with all the numbers 1 to n again to get just the duplicate number, as every number would appear in the XOR twice except the duplicate number which would appear once.

Edit: I misread the problem :D I initially read it as every number appears once and one number appears twice, but alas it's not so simple :D

Re:The World Excel Championship is being broadcast on ESPN by sanedigital on Thursday August 11, 2022 @10:14AM (#32425911)
Sum the input list, sum the list of [1...n], subtract and voila!
Re:The World Excel Championship is being broadcast on ESPN by robbie-c on Thursday August 11, 2022 @11:26AM (#32427180)
Yeah, sadly you're not guaranteed some of the things that are needed for this to work. I defo believe the story that it took Knuth a day to figure this out, although when you see the answer it's pretty easy to understand.
Re:The World Excel Championship is being broadcast on ESPN by sanedigital on Thursday August 11, 2022 @01:14PM (#32428861)
What things? I submitted it as an answer on Leetcode and it was accepted.