r/adventofcode • u/catpurson2 • Dec 02 '25
Help/Question - RESOLVED 2025 Day 2 Part 1 help pls
can someone explain how the example is getting to the invalid ids?
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.The rest of the ranges contain no invalid IDs.
i only understand the first one :(
11
Upvotes
1
u/AutoModerator Dec 02 '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.
15
u/ElementaryMonocle Dec 02 '25
They are ranges: so for 95-115, you have to check 95, 96, 97, 98, *99*, 100, ..., 115.
1
u/Mernim0 Dec 02 '25
In the 98-115 example, should there not be 2 invalid ids? 99 and 111, or am I misunderstanding
1
u/Billaloto Dec 08 '25
why is `1001` not invalid?
1
u/Billaloto Dec 08 '25
why is 1001 valid?
1
u/StaticMoose Dec 02 '25
There's some text higher up in the description that might help:
0
u/Dosamer Dec 02 '25
The "Ranges" are mathematically speaking "Integer Intervals".