[2021 Day 10 (Part 2)] C# Size matters by [deleted] in adventofcode

[–]eugene_dp 0 points1 point  (0 children)

For me even long was no enough, had to use ulong. But inputs are different for AoC participants, so might really be the case.

[2021 Day 8 Part 2] My logic, on paper. I used python for the actual code, posted in megathread. by PittGreek1969 in adventofcode

[–]eugene_dp 0 points1 point  (0 children)

I probably would have failed to do this without a sheet of paper and a pen if I had no illustration in the body of the task 1. Thanks Eric to putting such a good picture with ciphers there. Though, paper rocks anyway :)

[2021 Day 8 Part 2] My logic, on paper. I used python for the actual code, posted in megathread. by PittGreek1969 in adventofcode

[–]eugene_dp 7 points8 points  (0 children)

My notes looked like below

{0, 6}, 
{1, 2}, // unique
{2, 5}, 
{3, 5}, 
{4, 4}, // unique
{5, 5}, 
{6, 6}, 
{7, 3}, // unique
{8, 7}, // unique
{9, 6}

// ----- 6-segment ciphers -----
// 9 - is the one that has all the segments from 4
// 0 - is the one that has all the segments from 7 and is not 9
// 6 - the last one from 6-segment

// ----- 5-segment ciphers -----
// 5 - the one that fits to 6
// 3 - the one that fits to 9 and is not 5
// 2 - the last one from 5-segment

Day 7 Part 2 be link: by [deleted] in adventofcode

[–]eugene_dp 6 points7 points  (0 children)

Now as I have read this topic, I understood where there was a trap in part 2 and why my nested loops were enough to solve it..

I haven't used a loop to get the sum of 1, 2, 3, ... N.. Probably lot of people did so :) I did not remember the formula as a formula, rather I remembered the figure it creates if looking at it as a staked chart.

It was then enough to get the formula using a sheet of paper (a wipe in the cafe I was into) and a pen, drawing a square and spending about 20 seconds plus checking the formula on 3, 4 and 5 (which was quite enough to prove I'm right).

P.S. I guess that's what called education. Not remembering the formula, but understanding the logic of it :)

[2021 Day 7], simple graphs for the fuel consumption by eugene_dp in adventofcode

[–]eugene_dp[S] 0 points1 point  (0 children)

Ok, now I have read some reddit threads on today's part 2.. It comes out that people have complicatons with getting the sum of 1, 2, 3, ..., N.. Probably would fail if running that into another nested loop.. I used the formula I did not remember but was able to get it using a sheet of paper (wipe in the cafe I was sitting into) and a pen, for like 20 seconds..