AdventOfCode2021 - Day 4

This is a thread to discuss Day4
https://adventofcode.com/2021/day/4

REMEMBER!
It is VERY important NOT to write any public spoilers :slight_smile:
ALWAYS keep spoiler stuff hidden inside one of these

Summary

This text will be hidden

which you can obtain by clicking on the gear icon

image

Got Part 1 done (been a busy day)

duration = 5 secs

Project

Here's my solutions

Part 1





(the convert to number block just makes strings return 0)

This is my first solution that takes a long time. I just couldn't find a way to make it go faster.

Part 2

Duration = 32314 milliseconds, or about 32 secs.

Project

plz,can you log the duration time for each part of this and future project

I just don't have a block that can detect time, so I don't bother with it. Sorry. I also put a link to my project so you could time it yourself.

Import from my project or check at cymplecy project

Struggling with Part 2
Always annoying when your code runs the test data Ok but fails on the real input :frowning:

[edit]
I think I've found my error - I'm collecting indexes of boards to be deleted and then going thru that list and deleting them

I've forgotten that once I delete an item - the remaining indexes are wrong! :slight_smile:

Going to sort them into reverse order 1st and try again ....

... that didn't fix it :frowning:

Got in done - duration 7 secs

https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=ad21_4&editMode

project

it work but take long time... 84sec

I'm late to the party, but my program runs pretty fast and I see why everyone's so excited about columns now :wink:

here's the link to the project: Snap! 6.9.2 Build Your Own Blocks

p.s.: @Simon, I think your's doesn't work for all bingos. I loved the idea of replacing by 0 because of the addition in the end. However, it didn't work for my file since the bingos contain 0 as well.

#LOL :slight_smile:

I never noticed that there could be zeros - pure luck that it it didn't affect my outcome :slight_smile:

The force must have been strong with me :slight_smile: