54
SOLUTION MEGATHREAD-🎄- 2019 Day 4 Solutions -🎄-(self.adventofcode)
submitted 6 years, 1 month ago* (edited 7 minutes after) by daggerdragon to /r/adventofcode (134.8k)
since 6 years, 1 month ago
5 of 5
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


[removed]
Restore AllHide UnarchivedI don't understand the
countpart, wouldn't it erroneously validate numbers like 123451 (1 has count 2)?No. 123451 would have never past the first conditional because there is a decreasing sequence from 5 to 1. All of the numbers will be the same or increasing so you will never see numbers out of order! Copy the python code above and print out the "passedsecond" list and you will see what I mean. That is why the count() function can be used here.
You're absolutely right! Numbers that passed the first check will have sorted digits. Thanks!
this is great!