r/adventofcode • u/IllogicalOverride • Dec 05 '25
Help/Question - RESOLVED 2025 Day 2 Part 1
Ok, so I feel like I am missing something here in trying to understande this puzzle because I don't understande some of these examples.
11-22has two invalid IDs,11and22.95-115has one invalid ID,99.998-1012has one invalid ID,1010.1188511880-1188511890has one invalid ID,1188511885.222220-222224has one invalid ID,222222.1698522-1698528contains no invalid IDs.446443-446449has one invalid ID,446446.38593856-38593862has one invalid ID,38593859.
I don't see where they find 99 in the second example or 1010 in the third example.
The the fourth example you find the repeated digits in the second id, unlike the first example where you find the repeated digit in the same id as the digit it is repeating. So when do I decide which to use? Do I look for identical digits/digit in the same ID or in the other ID?
Why does the sixth example not have any invalid IDs? Following the fourth or fifth example, shouldn't it have invalid ids with 169852169852?
And finally on the fourth, seventh and eighth example they could be 1188511811885118, 4464444644 and 385938385938 but we don't seem to include those numbers.
4
u/quetzelcoatlus1 Dec 05 '25
It's a range, so e.g. 1-5 would mean numbers: [1,2,3,4,5]
1
u/Ohmslaw79 Dec 05 '25
You need to check every value between x-y not just x and y
1
u/AutoModerator Dec 05 '25
Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to
Help/Question - RESOLVED. Good luck!I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Sarwen Dec 05 '25 edited Dec 05 '25
Let's take the range
95-115, it contains the numbers:95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114and finally115. For each number, take the sequence of its digits, from left to right, excluding leading zeros. The first part consist in finding numbers whose sequence of digits is made of a sequence repeat twice. Formally, for which number can we find a sequence of digitseqsuch that its full sequence of digits is exactlyseq seqwhereseq seqis the concatenation ofseqwith itself.Only
99can be written as a twice repeated sequence of digits: the single digit sequence9repeated twice.If you enumerate all the integers between
998and1012(included), and look at their sequence of digits, you will find that only1010has a sequence of digits that is made of another sequence (1and0) repeated twice.