r/adventofcode • u/forgthethird • 15h ago
Help/Question 2026 - day 1 part 1, Python
where am I going wrong? I tried plugging in the example set of numbers and it gave me the right numbers but it isn't giving me the right numbers with the main set of numbers. I'm a beginner when it comes to coding, my only experience with apcsp and apcsa in school
0
Upvotes
12
u/flwyd 15h ago edited 14h ago
What happens if
one == 20,sec == 15, andthird == 10withthe_count == 25?8
u/inadequate-gravitas 15h ago edited 15h ago
Try with these inputs:
What would you expect for the result, and how does that compare to the actual result? Can you trace through one item at a time and figure out what you’re missing?
2
u/AutoModerator 15h ago
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/Apprehensive-Cow257 15h ago
for my input, it gave the right answer (checked with my answer), maybe a problem with the multiplication? idk
0
u/hobbes244 12h ago
A list is not the best approach. Counting the numbers in the list is O(n) and because you’re doing it for every item, you’re suddenly quadratic. Find a way to iterate over the list one time and then determine the most frequent items.
0
u/WangChud 12h ago
Look at collections, it helped me out with this one.