AdventOfCode2021 - Day 5

This is a thread to discuss Day5
https://adventofcode.com/2021/day/5

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

2 mins to complete Part 1

Part 2 - 31 secs

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

project

part 1 -> 150sec (329 lines)
part 2 -> 277sec (500 lines)

@cymplecy : part 1 is very very similar than your's !

what is advent of code?

Give it a try !

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.

You don't need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far. Nor do you need a fancy computer; every problem has a solution that completes in at most 15 seconds on ten-year-old hardware.

not sure for that one in snap...

:laughing:
..............

Part1, 4-6 s

Part2, v7 is fast!!!!! ~10 s, v6 => 90s

Project

What am I doing wrong? this is taking so long, on line 100, 500 after 20 mins, gonna run it in my bag during school, but why is it so slow? Snap! 7 - rc3 - Build Your Own Blocks Suggestions welcome!
Edit: srry meant to reply to topic not post

I use "group by" a the last step and a compiled "map" ("ligthning bolt", compile in local menu).

compile makes it faster right?, but i only use map in the setup, the real slow thing is when I am sdding each point to the list, and what does group by do? srry for replying to post by mistake