#advent-of-code

1 messages ยท Page 18 of 1

fleet fox
#

man

#

i have to remove my examples as well

#

noooo!!!

low condor
#

They are from your input?

fleet fox
#

the example they give

#

im putting it in my code lol

hazy ermine
#

thats fine ig

#

or is it

low condor
#

Hmm ๐Ÿค” none of my unit tests would be acceptable if we couldnโ€™t do that

fleet fox
#

is it fine

#

๐Ÿค”

hazy ermine
#

i believe so since its the same for everyone

#

and its publicly available on the website anyway

#

but not sure

fleet fox
#

hmmmm

vestal token
#

so far, what's been the hardest day?

hazy ermine
#

day5 probably

low condor
#

Deffo Day 5 P2 but Day 1 P2 and Day 3 get honourable mentions

#

Day 1 P2 annoyed me the most lol

vestal token
#

i feel that there hasn't been an increase in difficulty from day 1 to day 9

magic oxide
#

day 8 p2 annoyed me the most, day 1 p2 took me the longest relative to how difficult it was, day 5 p2 took me the longest period

hidden musk
#

it hasn't really been linear

low condor
#

Eric deliberately doesnโ€™t make it exactly linear, but even so this year has been a rollercoaster

hidden musk
#

i genuinely gave up on doing day 5 part 2 efficiently

magic oxide
#

tbf u were doing it in like what

#

prolog?

hidden musk
#

yeah

low condor
#

The language challenge has been fun - not because Iโ€™ve done it but because itโ€™s been entertaining to watch from the sidelines

magic oxide
#

you know what would be an added challenge for the roulette?

#

no docs

#

or stackoverflow

#

or anything

#

u have to figure out how the language works just by running it

hazy ermine
#

come on that would mean we wont be learning anything

fleet fox
#

i would lose it

magic oxide
#

i would think you'd learn a lot simply because you're forced to to solve the problem

hazy ermine
#

true but there should also be enough time

#

since doing it like that takes a lot longer

royal gull
hazy ermine
#

๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

#

man i honestly expected little more hints for d8p2

royal gull
#

What happened was: ||On first read, I assumed it looped back to the start after reaching the finish, making the LCM solution obvious||

lime fulcrum
#

today is kind of hard

hidden musk
#

that's actually wouldn't be fun though

#

if you just go in without knowing anything then you just have to guess at everything

woven solar
magic oxide
#

but

woven solar
#

but the input just happens to be such that you don't need the fully correct solution

magic oxide
#

if you had some prior experience with the language

hidden musk
#

you would need a lot of experience to do it without docs

#

like, python or rust, i could probably do. not a random language

magic oxide
#

i guess i haven't done the roulette so idk how difficult it is

hidden musk
#

well i guess it depends how much "prior" is

#

like, i had used vb, ocaml, and haskell

#

but i was still dying ๐Ÿ˜ฉ

minor cave
#

The repo stats are gonna look real cute though!

hidden musk
#

yeah it's quite colorful

magic oxide
#

dang that purple one

hidden musk
#

vb

#

the card day

royal gull
#

Waiting for my sql day.

hidden musk
#

๐Ÿ‘Ž

flat sequoia
#

I donโ€™t do this fwiw

#

I have code to programmatically retrieve the input but thatโ€™s basically it

#

And a thin wrapper that just opens the right files

#

And I only started auto fetching input halfway thru last year

simple raven
flat sequoia
#

Yeah that was crazy!!

simple raven
flat sequoia
#

I think itโ€™s a combination of problem solving experience (quick thinking and adapting existing patterns youโ€™ve seen) and knowing the language super well

simple raven
#

not at all surprised that p2 took you 20s ๐Ÿ˜„

flat sequoia
#

Yeah I read p2 and was like thatโ€™s it?

#

Almost didnโ€™t believe my reading comprehension

#

Idk personally having a library doesnโ€™t seem that helpful to me, though maybe some parsing helpers would be beneficial

#

But I feel like the times when parsing is annoying is when the format is really weird and idk if your library would work anyway

#

Also wow Iโ€™m like barely ahead of this Kevin guy

#

Sold too hard on day 8 I guess

pine tiger
#

oh god turns out i've been doing aoc all wrong ๐Ÿ˜ญ

pine tiger
flat sequoia
#

Honestly like same

#

I always troll on those like do a MAX instead of MIN ahem

#

I need to slow down a bit sometimes

pine tiger
#

my brother in christ you've been #1 every goddamned time

jovial jay
#

Looks like I'll have to remove the inputs file. ๐Ÿ˜ฆ

#

but, does this mean I can import from URL instead?

peak dock
#

i just gitignored the file

jovial jay
#

ok, looks like i can use URL instead

hidden musk
#

at least you'll learn about the reflog now ๐Ÿ“ˆ

pine tiger
#

hm

#

i take it can't even copy the example input?

hidden musk
#

i think that's fine. you can see those without logging in anyway

#

and i haven't seen anything saying otherwise

simple raven
hidden musk
#

o rly?

pine tiger
#

well

#

now i've seriously no cue

#

*clue

#

as to what to do

jovial jay
#

that's why i'm changing my code to load from URL instead.

pine tiger
#

i mean then you have to do the login and everything i presume
which i have no idea how to do lmao

jovial jay
hidden musk
#

don't you need to be logged in to access inputs though

jovial jay
#

you can copy URL when logged in, and then paste it into your code to load from there

hidden musk
#

you need your session token

simple raven
#

you could just scavenge the request from aoc-lube

#
        response = requests.get(
            url=URL.format(year=year, day=day) + "/input",
            headers=HEADERS,
            cookies=TOKEN,
        )
pine tiger
#

whatโ€™s headers and token

minor cave
#

token is your session token. If you log into AoC and check your browser storage/cookies, you should see something like session. A long string of alphanumeric. You need that

simple raven
#

and token your user token

minor cave
#

for our leaderboard feature in Sir Robin, it looks something like this:

url = "https://adventofcode.com/{year}/leaderboard/private/view/{leaderboard_id}.json"
AOC_REQUEST_HEADER = {"user-agent": "PythonDiscord AoC Event Bot"}
cookies = ... # we read this in from our envars, but it's the AoC session cookie for my account
async with aiohttp.request("GET", url, headers=AOC_REQUEST_HEADER, cookies=cookies) as resp:
    ...  # do whatever we need with the leaderboard results
wet yoke
#

That feeling when you finish day 9 part 1 right before heading out for a social function and I just can't physically do part 2 yet. ๐Ÿ˜ฎโ€๐Ÿ’จ

untold briar
#

At least you finished

#

Imagine being really close but not able to finish part 1 before going out

#

๐Ÿ™ƒ

ripe meteor
#

Saturdays do be like that

sleek cave
#

programming problems like aoc have actually rewired my brain
my first thought upon grabbing this box of milk was "oh hey, that's a tiling, i wonder how many ways you can tile an m by n rectangle with 1 x 3 and 3 x 1 tiles"

#

and now i'm actually intrigued

#

because ik tilings of 2 by n using 1 x 2 and 2 x 1 can be solved using dp

#

but that's a wayyyy simpler problem

ripe meteor
#

Tile bad, wood floorboards is where its at

dense osprey
#

how did you guys write your cycle detection algorithm in yesterdays part 2?

#

due to the graph not having to be a functional once, my goto choice wont work

#

and a "subcycle" could be repeated multiple times in once cycle

simple raven
#

I don't know how big of a spoiler you want but ||the input is special making the task much easier than you (and originally I) think||

dense osprey
#

oh

#

oh

#

||input has the same amount of strings ending on Z as strings ending on A||

simple raven
dense osprey
simple raven
dense osprey
#

no 1sec

#

i think i can do it

dense osprey
#

but im not sure if that matters

#

im trying to think of an input where the optimal result wont have the nearest z node for each a node

#

but if it doesn tmatter

dense osprey
#

idk why

#

||lcm of nearest distances||

#

idk how id prove it

#

found it randomly

#

i dont understand my solution

simple raven
# dense osprey idk why

oh boi you're in for a rollercoaster of comments if you go to either the solutions channel or reddit ๐Ÿ˜„

dense osprey
#

are there a lot of people who dont understand it

simple raven
#

||you need to make like 5 or 6 assumptions for it to work||

dense osprey
dense osprey
#

but

#

i dontr like problems like that

#

they couldve said that in the description of the problem

simple raven
mellow mesa
#

Am I wierd for not liking yesterday for giving too few hints / and not liking today for basically giving us the solution.

dense osprey
#

cause when i try solving problems like this, i try to design some algorithm such that every input complying wit hsome set of constraints would work on it

woven sable
#

honestly i would've liked today and day 5 to be flipped

simple raven
#

making puzzles is hard ๐Ÿคทโ€โ™‚๏ธ

woven sable
#

today felt awfully easy for day 9

#

but i'm not complaining these puzzles r sm fun

mellow mesa
#

Yeye ofc, I love aoc either way, just when I think about it

dense osprey
mellow mesa
#

This is also a closed off discussion forum, wouldn't really voice this on reddit or something

dense osprey
#

why?

mellow mesa
#

Just doesn't see it being necessary, especially when this is something we do for fun and the author has the heart in the right place

#

Just would have been nice to find the extrapolation part for today on my own (if I would have gotten to it)

dense osprey
rancid creek
#

so I've put together a difficulty chart for advent of code based on recent years, and aligned it by weekday. There doesn't appear to be a "weekends are harder" trend as much as a "later in the month" harder trend.

simple raven
#

in my mind 1 is medium and 7 and 4 are switched, but that doesn't change much

#

oml 2019 was brutal ๐Ÿ˜„

rancid creek
simple raven
#

so we are about to enter the main medium territory

#

ah okay

rancid creek
simple raven
#

I'm glad they are making AoC more mainstream over the years ๐Ÿ˜„

rancid creek
#

I think the skill of participant also increased over time, so that might be reflected in there as well, and why I'm not going back to the first 3 years.

#

some of those extremes were 2 hour + solves by the top 100 peeps.

cyan sleet
#

less people competed back then

ancient surge
#

whats advent of code?

cyan sleet
#

like, divide all gold times by the longest gold time that year

low condor
#

I remember 2020. Only one "extreme" puzzle and it wasn't even that difficult, it just involved a lot of "legwork"

rancid creek
simple raven
low condor
#

yup - the seamonster one

ancient surge
lusty rover
dense osprey
rancid creek
dense osprey
#

ah

cyan sleet
low condor
#

yup - agreed. Not difficult, but it takes legwork

rancid creek
#

first person to finish was at 25 minutes, the leaderboard filled at 1 hour 15 minutes

rancid creek
lusty rover
lusty rover
rancid creek
#

I added in insane as an after thought, and it only really applies to the older years.

cyan sleet
#

was 2019 2nd insane space cards?

dense osprey
#

or not mainly due to the problems difficulty

cyan sleet
#

wrong reply, but thanks

#

I liked that problem

royal gull
cyan sleet
#

(as I've said before)

cyan sleet
dense osprey
#

idk if it matters

#

why are there so many numbers of the form 100.0007 which are primes

#

1e9 + 7 is also one

#

17 is one

cyan sleet
dense osprey
#

107 is one

cyan sleet
#

||17||

dense osprey
#

oh nvm 1007 isnt and 100007 also isnt

lusty rover
dense osprey
#

was at this part

cyan sleet
#

and same size leaderboard

rancid creek
simple raven
# cyan sleet

omg how do you even approach writing code for that?

#

I assume the problem essentially asks you to create some sort of hyper-optimised look-up table?

cyan sleet
#

basically, after you figure out what one shuffle does you can extrapolate quickly

simple raven
cyan sleet
#

do you know the matrix power approach for computing fibonacci numbers?

simple raven
cyan sleet
#

basically when you have one shuffle figured out you can solve the thing in roughly log(that big number) time

cyan sleet
simple raven
#

makes sense

cyan sleet
#

in general if you mult by that matrix n times you take n steps

dense osprey
#

i hate it

#

i dont want to know the context

cyan sleet
cyan sleet
dense osprey
cyan sleet
simple raven
#

I like lin alg, it's like watching a magic trick I don't understand but it's cool to see how it's done

cyan sleet
cyan sleet
simple raven
#

left side matrix to the nth power?

cyan sleet
#

expressed in powers of two: 85 = 64 + 16 + 4 + 1

#

we can compute powers of two pf a matrix easily by just squaring the matrix

cyan sleet
sharp tapir
#

hey could someone possibly give me a pointer on day7?

simple raven
#

do you then do

[0 1]^n [a] = [ Fn ]
[1 1]   [b]   [ Fn+1]
``` ?
sharp tapir
#

hand_rank={'A':14, 'K':13, 'Q':12, 'J':11, 'T':10, '9':9, '8':8, '7':7, '6':6, '5':5, '4':4, '3':3, '2':2}

dict={'Five of a Kind':[],
      'Four of a Kind':[],
      'Full House':[],
      'Three of a Kind':[],
      'Two Pair':[],
      'One Pair':[],
      'High Card':[]}


with open('Day 7\input.txt','r') as file:
    lines=file.readlines()
    for i in lines: 
        hand,bid=i.strip().split()
        
        dict_temp={}
        for c in hand:
            if c not in dict_temp:
                dict_temp[c]=1
            else:
                dict_temp[c]+=1
        
        # classify the hand
        if 5 in dict_temp.values():
            dict['Five of a Kind'].append(hand)
        elif 4 in dict_temp.values():
            dict['Four of a Kind'].append(hand)
        elif 3 in dict_temp.values() and 2 in dict_temp.values():
            dict['Full House'].append(hand)
        elif  3 in dict_temp.values() :
            dict['Three of a Kind'].append(hand)
        elif list(dict_temp.values()).count(2)==2:
            dict['Two Pair'].append(hand)
        elif 2 in dict_temp.values() : 
            dict['One Pair'].append(hand)
        else:
            dict['High Card'].append(hand)
        
        print(dict)
    for i in dict.items```
im kinda stuck here because i now need to literally sort through the hands with the strongest first. Is this the way for a noob/intermediate to go about it ?
#

(sorry for the massive wall)

#

if you want me to delete i can

cyan sleet
#

and yeah

simple raven
simple raven
# cyan sleet and yeah
[0 1]^n [1] = [ Fn ]
[1 1]   [1]   [ Fn+1]
``` so this is how I get fibonnaci numbers super quick? how does that relate to the solution of day22
sharp tapir
simple raven
#

yeah

sharp tapir
#

fk

#

did you generate the category list of hands first ye?

cyan sleet
simple raven
#

yeah, in a dict just like you, then sorted the lists within each category

sharp tapir
#

like this

#

ok

#

ok let me see

#

thanks boss

dense osprey
simple raven
#

so instead of tracking the whole deck you just track where the one card 2019 goes?

dense osprey
#

and i noticed that i compute the type of your hand way too often

#

up to n times for each hand

#

cause i didnt save the type and just called a function to compute it in my custom comparator function

#

wait

#

are we talking about this years blackjack problem

simple raven
dense osprey
#

yea

#

poker

#

what was i thinking ๐Ÿ˜ญ

#

blacjack doesnt have hands

#

like these

sharp tapir
#

when you iterate through your dictionary of all your hands

#

are you doing outside of the main loop ?

low condor
sharp tapir
#

main loop being the one where each line / hand is being evaluated and classified

#

it doesnt make sense to do it there cuz much easier to sort at the end right

#

when all the ahnds are categorised

simple raven
dense osprey
cyan sleet
simple raven
simple raven
cyan sleet
#

it's log of that second number

simple raven
cyan sleet
#

that first number you just need to be clever about, you can't just simulate the full deck like in part 1

low condor
cyan sleet
#

but you can still compute the effects of the shuffle

low condor
#

my code drops from 0.2 to 0.02 secs

dense osprey
cyan sleet
#

I liked my approach to the poker problem

rancid creek
#

which managed to get the right answer.

cyan sleet
#

and sort by that integer

low condor
simple raven
#

I do a bunch of sorting and appending to lists etc and it runs in 4ms

simple raven
rancid creek
#

ah !

simple raven
cyan sleet
rancid creek
# simple raven I couldn't even sort a list in python in 2019 ๐Ÿ˜„

if you're curious this was my finished solution for 2019/22:

def solve(c, n, p, o=0, i=1):
    inv = lambda x: pow(x, c-2, c)
    for s in [row.split() for row in orders.splitlines() if row]:
        if s[0] == 'cut':  o += i * int(s[-1])
        if s[1] == 'with': i *= inv(int(s[-1]))
        if s[1] == 'into': o -= i; i *= -1
    o *= inv(1-i); i = pow(i, n, c)
    return (p*i + (1-i)*o) % c

for x in [(10007,10005,2019), (119315717514047,101741582076661,2020)]:
    print(solve(*x))

my initial part 1 was more brute force.

simple raven
#

but gj on getting it done ๐Ÿ™‚

cyan sleet
rancid creek
#

number of lines ~10. time to complete listed at 15 hours rank #1200

dense osprey
#

imo

#

but my code isnt good either

simple raven
#

the for loop is just part 1 and part 2, why unnecessary?

dense osprey
#
print(solve(*tuple1)); print(solve(*tuple2))```
rancid creek
cyan sleet
#

I think I was in the US on a business trip end of 2019, do I couldn't have done it quickly even if I wanted to ๐Ÿ˜…

rancid creek
lime fulcrum
cyan sleet
#

2018 was the one year I did kinda do leaderboards, despite timezones

#

56

rancid creek
sharp tapir
#

how long has everyone been coding?

#

i started in june

cyan sleet
#

speaking of sketchy code

#

this year is quite sketchy code with the language roulette ๐Ÿ˜›

rancid creek
cyan sleet
sharp tapir
#

leetcode

rancid creek
sharp tapir
#

but nov/dec dont count because i was doing a sql bootcamp in person

#

it should be much more active hah

lime fulcrum
cyan sleet
#

I did project euler stuff back in like...2009?

sharp tapir
#

ur ancient

#

one thing about dev community

#

is how supportive everyone is

rancid creek
#

2009 = ancient. ๐Ÿ˜

lime fulcrum
#
    if "J" in hand:
        res = []
        jlist = [[] for _ in range(7)]
        for i in range(12):
            handtest = line[0].replace("J",cards[i+1])
            jlist[handvalue(handtest)].append([cardsortvalue(handtest,value),handtest])
        for categories in jlist:
            res.extend(sorted(categories))
        handtest = res[-1][1]
        group = handvalue(handtest)``` just not that clean
noble skiff
#

I did my first programming competition in like 2001 probably

#

I guess I'm pre ancient

#

Primordial?

cyan sleet
#

xelf was one of the first prototypes, he's kept up fine with the years with only minor maintenance

hidden musk
simple raven
# sharp tapir how long has everyone been coding?

I first met python when I did physics master's around 5 years ago, but the course was so dense I didn't learn anything, but I really started learning python during covid and been coding since, just not CS stuff as much as other people here

sharp tapir
#

and

#

getting better there means knowing how to code

#

so here i am

tepid cairn
#

I started around Covid as well ๐Ÿ‘€

sharp tapir
#

i started in jun-23, dabbled start of the year w/ web3 but im not gonna count that

#

really really late

noble skiff
sharp tapir
#

bit sad

simple raven
zenith elbow
woven sable
#

covid basically

woven sable
#

i feel like i peaked in covid coding wise tho

sharp tapir
#

covid rly got a bunch of ppl in

woven sable
#

i think i know a lot more langs now but idt i'll ever be as good as python as i was in 2021

simple raven
#

I had to learn to code during covid for my phd

woven sable
#

i j don't understand internals like i used to

sharp tapir
#

ok yall distracting me need to finish day 7 aaaa

lime fulcrum
tepid cairn
#

my dad would hoard old computers and stuff, I dug one out and got it running, and that was my first real introduction to computer related stuff

noble skiff
#

I built my first computer with my dad 1991

simple raven
noble skiff
#

It was his computer to be clear ๐Ÿ˜›

#

I was mostly watching

woven sable
#

i have like another really big side hobby and i got into programming by figuring out that i could do a lot of cool stuff with programming so i started coding and then i got really into it

#

i had like a new project every week

simple raven
woven sable
#

cuz i think i'm def a better problem solver now

#

and i can pick up langs easier now

simple raven
noble skiff
#

Ah I was relatively close

#

JeremyJoe is surely the most American name a Slovakian ever had

simple raven
woven sable
#

that's true

#

like i was horrible at learning new languages like one or two years ago and a few motnhs ago i j found kotlin and picked it up pretty fast

simple raven
woven sable
#

i love it

#

only thing i don't like is the stdlib is pretty lacking

#

the json parsing is a pain

#

and there's no || lcm function so i had to search up an lcm calculator online for day 7 part 2 because i didn't want to put in the effort in creating one myself ||

#

that's a pretty useless gripe tho

#

overall it's amazing, esp the predicate functions

#

i was doing aoc in kotlin that day

cyan sleet
rancid creek
noble skiff
cyan sleet
lime fulcrum
cyan sleet
#

if you can compute gcd you can compute lcm

simple raven
zenith elbow
woven sable
#

which kind of annoys me

noble skiff
#

I remember pre Internet days though

#

Like I remember when people started talking about it but all you could do was like log into certain libraries

#

No world wide web yet maybe

sleek cave
#

starting day 9!

#

first thoughts give me ||coefficient solving|| but i don't wanna figure out ||solving a system of linear equations|| (i think it has something to do with ||linear algebra|| but i don't know ||linalg|| at all ๐Ÿ˜‚)

#

so i might just ||naively simulate for part one||

cyan sleet
#

back when internet and www was pretty distinct things

atomic cairn
zenith elbow
sleek cave
#

now i really want to do a ||linear algebra|| solution for fun

sharp tapir
#

could anyone assist me with day 7?

#

i have an answer but its saying its too low

#

for some reason..

#

happy to share code

#

it works on the test case

low condor
rancid creek
sharp tapir
#

But still not sure why original solution doesnโ€™t work

#

I thought my approach of getting the (length of the lists from inferior categories + index of hand +1 )should work but it weirdly doesnโ€™t

rancid creek
#

I'm not even sure what that is. ๐Ÿ™‚ But congratulations on getting it done!

zinc kindle
#

Going through old problems and wow, 2018 day 23 part2 was a nightmare to solve. 3d geometry is a pain, tried a solution based on ||overlapping irregular octahedra||, tried to write a 2d solution before extending it to 3d, couldn't. Gave up.
Tried a simple algorithm, gave wrong answer on sample inputs (or maybe I implemented it wrong).
Eventually I just went and ||wrote an algorithm to find a local maxima given a point, used rng to find a bunch of possible start points, and kept running until it seemed like it'd found the best solution. And that finally worked||

real quartz
#

Holy hell. I'm still stuck on Day 1. It's making me think that I need to get more experience in older AoC before I even attempt 2023's version

#

Whoever told me that the difficulty was all over the place wasn't kidding

magic oxide
#

day 1 is unusually hard this year yeah

rancid creek
earnest forge
sleek cave
earnest forge
rancid creek
rancid creek
minor cave
#

Also it's fine to skip days!

earnest forge
rancid creek
#

day 1 wasn't so hard that it's a skip day. day 5 could be a skip day.

earnest forge
#

(yeah, but the easiest way to get someone to feel like they're having fun is to start them with an easy one :P)

real quartz
#

Might as well, lol. Thanks guys.

jovial jay
#

I'm proud of solving Day 5 Part 2 and with a optimized solution too. So happy.

real quartz
#

Noice!

earnest forge
#

Presumably it's the ||interval arithmetic|| one (but maybe there's another better optimisation I hadn't thought of)

zenith elbow
slate berry
#

๐Ÿ˜” I was reading

jovial jay
zinc kindle
earnest forge
#

You meant ||irregular overlaps of octahedra||

covert arrow
#

I am actually ready today

#

GLHF

earnest forge
#

GLHF everyone

minor cave
#

Language Roulette: Day 10
The language is ... Fortran

sleek cave
sleek cave
#

I JUST REALIZED
AOC 23 LORE IS A CALL STACK

shut trellisBOT
magic oxide
#

oh right

#

I keep forgetting

#

doesn't look too bad

minor cave
#

midnight keeps sneaking up on me and then I see BillyBobby talk about it in pygen and scramble

magic oxide
#

lmao

#

hopefully p2 isn't too hard

#

don't have much time today

sleek cave
#

p1 seems all right

hollow wharf
#

i dont even know how to parse it

sleek cave
#

time to sleep on it and dream of grayscale wastelands where my sole company scurries away in forsaken labyrinths of black and rust

fleet fox
#

๐Ÿ’€

jovial jay
#

Day 10 looks pretty bad

earnest forge
#

WTF is part 2

fleet fox
#

what u already solved part1?

#

damn

jovial jay
#

here, i feel like i still need to grasp day 10 before attempting.

#

it took me a while to grasp day 5

cyan sleet
shy trench
#

part 1 honestly wasn't that bad

#

but i'm completely stumped for part 2

fleet fox
#

how do u do part 1

#

i have no idea where to start

minor cave
#

let's spoiler solutions in this channel please

shy trench
#

mb

tidal mist
#

no solutions thread ๐Ÿ˜”

minor cave
#

9 more to go!

#

I think that's you on the pt2 lb though ๐Ÿ‘€

covert arrow
#

my p2 works for example but not actual ๐Ÿ˜ญ

pine tiger
#

LMAO SO CLOSE

tidal mist
#

i almost gave up because i thought i was too slow. but still lb. ๐Ÿฅณ

minor cave
flat sequoia
#

Woooo finally a fun problem

#

I think I would have done pretty well if I didn't have to wait 5 minutes on part 1

#

But I mixed up | and - by accident

#

๐Ÿ˜’

pine tiger
#

๐Ÿ’€

pine ravine
#

looks like we got a hard one today aye?

earnest forge
#

38m was enough for 124th so I'mma go with yes

pine ravine
#

mmm i think i can do this but its going to be wildly innefficient

flat sequoia
#

I swear the hardest part for me was figuring out which direction the S went
I should have just looked at the input and hard coded LMAO

woven sable
#

i'm still stuck on part 1 wtf

timber glacier
#

help i keep getting an answer too high on part 2

#

i keep getting the same answer every time i make it too though

royal gull
#

In this day and age, why donโ€™t we have ascii art?

earnest forge
#

...we do?

royal gull
#

I mean, for aoc problems. F 7 J? My eyes hurt

earnest forge
#

Oh you mean you wanted unicode box drawing characters?

royal gull
#

Yah

earnest forge
#

that's not ascii

royal gull
#

. Its 2am and my eyes are blurry ๐Ÿ™‚

earnest forge
#

((and I think Eric wants to keep inputs as valid ascii which seems fair so as to not unnecessarily preclude the use of C))

pine ravine
#

owie my brain hurts

drifting gazelle
#

How to install discord components?

flat sequoia
#

idk I think it's cute

#

also i made a gif but idk why things are yellow

pine ravine
#

urs is cooler

royal gull
#

I love this

untold briar
#

Part 2 sure is fun

#

Though it's a bit hard haha

#

I have no idea how to check if a pixel is within a contour and had to consult google though

pine ravine
#

lets gooo that one was so fun

#

i did it all with color coding

atomic cairn
#

Today looks hard

#

But i wont be able to code today

austere basin
#

hey guys, i coded a solution for today part 1 which works for test input but it reaches the maximum recursion limit (around 1182 i think?). is there any way to get around this or do i just have to stop using functions??

untold briar
#

Use while loop and flags instead

rocky spire
untold briar
#

Python is not built to withstand big recursive loops

#

Or what purply suggested, yeah

austere basin
#

right... it's fine guys it's not difficult at all to modify it to stop being recursive

#

||also... just curious from looking at the animations, is part 2 the number of squares contained within the loop?||

#

cuz if so that will be fun :)

untold briar
#

Also, remember to add spoiler

austere basin
#

OH MB SRY

#

wait how do i do that again?

untold briar
#

Select the text and click the eye button

rocky spire
#

|| spoiler ||

untold briar
#

Or add || at both ends

austere basin
#

ok done

#

roughly what ballpark was your answer in?

#

cuz idk if i need to optimise

#

ah nvm got it!

#

sry guys another quick question - does the maze have any touching corners that would shut off enclosed sections to each other?

#

basically what i'm asking is - are all the enclosed squares touching each other?

#

because if so i can just bfs from a square i know is definitely within the maze

woven solar
#

||very much no, IIRC||

hidden musk
proud cosmos
#

today was fun

untold briar
#

But well, I couldnt think of an algorithm either and had to google haha

#

Algorithm hint: ||Lets say you are trying to determine if a certain point A is within the loop or not. If you draw a line from point A to the edge of the map, it may cut the boundaries once right?||
Hint (continue): ||It also may cut the boundaries more than once, but what are those numbers? Do they have something in common?||

austere basin
#

Haven't looked at the spoilers but I'm thinking of just bfsing from each point

hazy ermine
#

is the pipe structure symmetrical distance-wise?

simple raven
#

day10 I have finally met an unsurmountable challenge ๐Ÿ˜„ I've spent 2 hours buildings classes to solve part1 but I have no idea how to approach part2. Maybe later.

untold briar
#

I found that algorithm online too, not that I thought of it myself

#

We are dumb so we need to stand on the shoulders of giants

simple raven
# untold briar Or you can click on my spoilers

I will have to completely rewrite my solution ๐Ÿ˜ฆ in hints someone talked about ||the boundary rules|| so I might try to implement that, I'm just sad I cannot use anything from part1

untold briar
#

Do not limit yourself to anything

simple raven
#

my part1 was just ||1. make Maze class, 2. make Animal class, 3. let animal run through the maze||

covert arrow
#

So far I've seen 3 approaches for part 2:

  • ||go line by line and track how many times you've crossed the path to see if gaps are inside the loop||
  • ||floodfill with a scaled up version of the grid so there are gaps between walls for the fill to go through||
  • ||floodfill from all points on one side of the loop (relative to direction of travel) since the inside will always be on one side if you traverse in 1 direction||
lime fulcrum
#

part one should be doable?

untold briar
#

Part 1 is just if/else

#

Also a while loop, or recursion

lime fulcrum
#

my idea ||make a grid. get form of s. follow orders by checking which one i was last and not going there. until back at the start.||

simple raven
untold briar
lime fulcrum
#

i mean if that is a spoiler then you have bigger problems

untold briar
#

But then what are we supposed to discuss here

simple raven
#

here, grab some of these |

simple raven
covert arrow
simple raven
covert arrow
#

this is what happens

simple raven
simple raven
lime fulcrum
#

solution: replace all | with I

covert arrow
untold briar
untold briar
covert arrow
untold briar
#

For example, like this

#

Those edges coud well, really mess things up

#

So I did a little twist on the lines

#

Btw did anyone got 2 loops like this? I think probably not, but just want to ask.

covert arrow
#

nope

lime fulcrum
#

wouldn't that break the starting condition?

simple raven
lime fulcrum
#

because you can't determine what s is?

simple raven
#

yeah it would

magic oxide
#
..|...
--J...
...F--
...|..

is the top right region connected to the bottom left region?

simple raven
#

I believe it is

magic oxide
#
..|...
--J...
..F---
..|...

how about this?

covert arrow
#

also yes

magic oxide
#

k good

#

thx

simple raven
#

damn I don't think I have time to solve this today :/

magic oxide
#

not sure if I have time either tbh

#

need to pack for tmr

covert arrow
simple raven
magic oxide
#

oh wait I think I misunderstood the problem

#

what's the inside bit of

F------7
|......|
|.F--7.|
|.|..|.|
|.L--J.|
|......|
L------J
```?
#

ah wait nvm that can't happen

#

I see now

#

good ol Jordan curve theorem

hidden musk
#

fortran is dumb as hell ngl

magic oxide
#

I feel like there's a slightly clever solution here ||using pick's theorem||, but I'm too tired to figure that out

hidden musk
#

yesterday might have been the last roulette day ๐Ÿฅด

magic oxide
#

๐Ÿฅด

#

you're really gonna leave Fenix alone?

hidden musk
#

stop guilt tripping me ๐Ÿ˜Œ โœŠ

#

have been trying to figure out how to read all the input into an array for the past 2 hours

simple raven
#

lol I made a mistake and accidentally filled in all of the correct I's ๐Ÿ˜„

trim rain
#

i had to take a break for celebrations so i'm gonna continue from day 7 today or tommorow ๐Ÿ˜ฆ gotta catch up

low condor
#

Today is the most I've written for a solution in quite a while

#

whole solution is on the Day 10 spoilers channel if anyone cares to look :)

dense osprey
#

i dont want to solve this

#

but i have to

low condor
#

why do you have to?

dense osprey
#

if other people can solve this, i can

#

im not mentally challenged

#

and i want 50 stars this year

magic oxide
low condor
#

Just so you know, it's ok not to be able to, or not to want to, solve any particular puzzle

#

I'm a programmer for a living and some of the puzzles in previous years have really thrown me for a loop

dense osprey
#

oh its a 140x140 matrix

#

||what if i just floodfill for each tile if i can reach a border without crossing a pipe belonging to the main circle||

#

would prolly be a naive solution

#

but a solution

#

||obviously not floddfilling each tile||

modern terrace
dense osprey
#

||if a tile can reach a border, then every tile which can be reached from it can also reach the border||

low condor
#

I have a reply to this but will do so in the hints channel

untold briar
#

Lets continue in aoc-solution-hints channel

jovial jay
#

how do you folks do the spoiler things?

minor cave
#

||spoiler text goes here||

jovial jay
#

||I learned how to do the spoiler thing||

#

thanks

hollow wharf
#

||spoiler||

#

||got ya||

royal gull
#

Could you delete this or edit to spoiler ? Itโ€™s just a bit of a hint.

untold briar
# jovial jay thanks

Also you can try googling. Knowing which key word to put into google is also a good skill for a programmer I think.

#

I always try to google things myself first before asking for help.

minor cave
#

We don't have that kind of requirement and it's fine to ask that kind of thing for small stuff. Especially because it's relevant in this channel

untold briar
#

Since there will be times when you wont be able to ask for help

jovial jay
#

I know about Google things before asking. Just that I didn't felt like opening a browser, then searching at the time

hollow wharf
#

so somehow I started on 2015 AOC.. and completed 3 days lol

#

that "weather machine" link was confusing and took me back in time lol

#

time to start over on 2023 Day 1

jovial jay
#

you'll start regretting it on day 5, guaranteed

hollow wharf
#

lol is it more difficult than 2015?

jovial jay
#

never tried AOC before. I only started this month because I can grasp it now

hollow wharf
#

ah okay, yeah some of them seem like they would take me more than a day to do, but I did 3 days last night in 2015, so the beginning ones aren't so hard

atomic cairn
#

Imo atleast

#

I havent done today yet

bright haven
#

I liked day 10 a lot

atomic cairn
#

Il maybe do a bit of part 10 before i go to bed tonight otherwise i will try to do day 10 and 11 tommorow

#

I still need to find a day where i have alot of time for day 5 part 2

untold briar
untold briar
#

So you could skip a day and turn back to it later

atomic cairn
#

Day 2 was way essier then day 1

#

Yesterday was easier then day 5

hollow wharf
#

I did not know you could skip, thats good. This is my first year doing aoc, mostly my first week interacting with this server

untold briar
#

Because day 5 is not necessarily easier than day 6, for example

#

๐Ÿ˜

untold briar
atomic cairn
#

Day 5 broke my streak

untold briar
#

You can also wait until the last day and do it starting from day 25

hollow wharf
#

I heard you get hired automatically at any job you want if you do that

#

(in santa's workshop)

#

you could be santa

untold briar
hollow wharf
#

lul

cyan sleet
untold briar
#

I find AoC to be a very good event for learning

untold briar
#

Or maybe some import commands if you were hyperly-organized the days before

atomic cairn
honest nacelle
#

Don't even know where to start with part 2....

low condor
honest nacelle
#

Yeah, I will in just a minute

#

Actually might just take a break, feeling a bit defeated atm

low condor
hazy ermine
#

@low condor you made a non-naive solution if i read the chat correctly... can you give some hints regarding that?

honest nacelle
#

god I have a headache

low condor
honest nacelle
# low condor Because of AOC or just in general?

Because of AoC, just having trouble wrapping my head around things today and a lil discouraged because I'm falling behind on my workplace's private leaderboard. I think I need to accept that I won't solve it right now, though, just banging my head on a wall at this point

low condor
peak willow
#

I have been surprised to see how many different approaches there are to some of these problems.

Obviously some approaches are better or worse than others. What I've been wondering is whether there is a... not so much a "right" answer or approach but perhaps an intended/ideal one?

bright haven
honest nacelle
#

people have been brute forcing using GPU cores, it's wild

peak willow
#

I mean, pedagogically, that's probably the point, right? That you learn how to match the right tools to the right problems.

peak willow
honest nacelle
bright haven
peak willow
honest nacelle
jovial jay
#

now doing day 7, it's actually fun

peak willow
simple raven
#

Gave it a good try but today's been too much for me. See you tomorrow

earnest forge
low condor
atomic cairn
#

well uhm very intersting case here

#

test case 1 works 2 doesnt but my solution is correct

hidden musk
#

@cyan sleet how is the fortran

lusty rover
hidden musk
#

i gave up

hidden musk
#

i think i'm gonna have to finish my finals before doing more ngl

#

previous days have eaten up multiple hours per day ๐Ÿฅด

sleek cave
#

part 1 doesn't even seem too hard to me after i solved it

#

but somehow my code was absolutely riddled with errors during the solving process

#

spent two hours tearing my hair out while thinking it's supposed to be the easy start

#

and now part 2 is crazy

#

the festivities of aoc have truly begun

flat sequoia
#

I haven't done anything before 2020 ๐Ÿ˜ง

jade atlas
modern terrace
#

8 minutes

magic oxide
#

today is going to be interesting

#

I landed in Japan at exactly 2pm 6 days ago, and my sim card is only for 6 days

#

so I might not be able to leaderboard because my sim card runs out and I have to change it

#

well that and also I'm bad at writing code fast

jade atlas
#

you could use wifi somewhere

magic oxide
#

I could but I don't really trust the free wifi

pine tiger
#

i mean idt aoc takes too much data

earnest forge
pine tiger
#

oh.

#

man, that's nasty

earnest forge
#

I very nearly asked what time zone before realising they said japan so I could just google it lmao

magic oxide
#

lmao

earnest forge
#

Anyway GLHF everyone apart from stickie ig

magic oxide
#

yeah I landed right as the problem released

#

glhf

modern terrace
#

i thought japan was in the same time zone as ph but i realized beijing is too

shut trellisBOT
modern terrace
#

and that's far from japan

minor cave
#

Language Roulette: Day 11
The language is ... Perl

tepid cairn
#

oh hey, it's not midnight for me anymore

flat sequoia
#

Done

hexed axle
#

Sub 10 minutes today, wow

earnest forge
#

221/108

#

I spent too long on a part 1 solution that was completely useless for p2

minor cave
shrewd thicket
flat sequoia
#

๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

#

I almost fell into the trap

pine tiger
#

today sucked absolute balls

modern terrace
#

YES

shut gust
#

just discovered about this

modern terrace
#

damn i sucked

shut gust
#

can't work on it until Sunday because of finals though ;_;

pine tiger
#

no p1 just took way, way too long
p2 i had to remember how dijkstra's worked as well

woven solar
#

||what's the dijkstra for||?

#

||ooh, I see, you used pathfinding||.

flat sequoia
#

Dijkstra ๐Ÿ˜ง

#

it's an empty grid

woven solar
#

(||pathfinding wasn't necessary, because the distances are just Manhattan||)

modern terrace
#

closest i've ever been to the leaderboards in p1

#

i seriously had to count the distances across the test input manually to verify if my solution would actually work

#

that cost a lot of time i think

flat sequoia
#

I ||wrote 1000000 instead of 999999 in p2 which cost me a good 30s||

covert arrow
#

||I was using 100 - 1 for example input and then forgot to change it||

flat sequoia
#

NOOO

flat sequoia
shrewd thicket
#

i spend a lot more time trying to figure out if my solution makes sense than just testing the solution

#

but ig i also use that time to think the solution through

woven solar
#

my template doesn't actually allow a test with different constants to the true input, so I had to skip the part2 test

#

it's annoying that the day doesn't provide the example answer for the right constant

pine tiger
flat sequoia
#

I had to write the right constant, change it to test, and change it back

jade atlas
#

I couldn't figure out why ||(scale * n_prev)|| did not work for me. Then I just tried ||((scale - 1) * n_prev)|| and the results matched. I spent a good amount of time thinking this will not work because the formula did not hold for ||scale=1||. Then I realized part-1 was actually ||scale=2||

jovial jay
#

Days are going too fast for me to catch up

zenith elbow
#

I had a fun time ||scaling up the density of empty space|| before calculating distances

mossy basin
#

scaling up density? you mean lowering the density

zenith elbow
#

ah yup

#

that's even cooler since empty space is already empty space lemon_happy

magic oxide
#

my method was more akin to ||scaling everything up and then scaling the galaxy space back down||

cyan sleet
hollow wharf
#

Do i still get 2 stars for doing day 10 today?

mossy basin
#

yep

hollow wharf
shut trellisBOT
#
Wrong Channel

You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.

hidden musk
royal gull
#

Too many holiday parties this weekend. Just finishing 10 p2 now.

#

Sql was not a good choice for that part.

ripe meteor
#

wasnt yesterday's roulette scala?

#

wait not that was day 9

hidden musk
#

Fortran day 10

pine tiger
#

god i have no idea why i'm so salty about day 11

#

this whole event is just a funny lil coding thing

ripe meteor
#

i cant believe i just got timed out by AoC

#

i've been submitting the sample input

#

im actually an idjiot ๐Ÿ’€

hollow wharf
#

1

#

2

#

3

#

4

ripe meteor
#

stop before you get voice banned

untold briar
#

3 2 1 boom

#

๐Ÿ˜

hollow wharf
#

Ok if itโ€™s like this then its ok

#

How are you doing today?

#

Youโ€™ve ate well enough?

#

Tell me about yourself

#

Something interesting

warm berry
#

This is off topic for this channel

hollow wharf
#

Bruv

warm berry
#

And if you try to spam messages you will be voice muted for two weeks

hollow wharf
#

I havent spamed i was being nice ๐Ÿ˜Š

ripe meteor
#

be productive member of the server
be allowed to use voice channels
now go to offtopics please

warm berry
#

โš ๏ธ DO NOT SPAM to meet these requirements, or you will be banned from verifying! โš ๏ธ

Any messages that are sent only to get your message count up are considered spam. To get your message count up without spamming, participate in conversations in โ python-discussion, or use the text chats for the voice channels while you listen.

hollow wharf
#

Ok cool

#

I dont know shit about python tho

#

Can i say shit? Opps

slate berry
#

How will they fit other problems

ripe meteor
#

we'll be coming down the islands

#

(i imagine)

slate berry
peak dock
wispy glacier
#

that's great haha

hidden musk
#

not even first smh

wispy glacier
#

what's the difference between a sponsor and AoC++?

#

sponsor is company-backed?

pine tiger
lime fulcrum
#

looks like someone is very active

compact wasp
#

internship hell

atomic cairn
frail pelican
#

oh sorry xd

atomic cairn
#

Np

austere basin
#

yo guys, anyone know of a good way to test code for deay 10 part 2? mine works with all the examples but gets the wrong answer on my input

austere basin
#

how would i know?

rancid creek
#

might be an off by one on the replacement?

#

are you correct for the*10 and *100 numbers?

austere basin
#

i don't know....

#

i got 312

rancid creek
#

For the example data.

austere basin
#

ohh okay no the example data is all correct

#

it gets all of that right

rancid creek
#

ah wait, you're asking about day 10. sorry I was thinking day 11

austere basin
#

ah dwdw

rancid creek
#

which method did you use for part2 ?

#

and 312 is probably close, there are many different inputs, my andswer for part 2 was in the 300s as well so you're pbably close.

austere basin
#

hi sry for taking a while

hollow wharf
#

cap

austere basin
#

Not cap, it just got shut down โ˜ ๏ธ

#

I can copy paste it and open a new one??

rancid creek
austere basin
cyan sleet
#

copilot pls

modern terrace
#

i didn't notice that

#

oh

cyan sleet
#

we're probably going back down

#

it's not the first year where days are out of order in the display

hidden musk
cyan sleet
#

I did

hidden musk
#

incredible

cyan sleet
#

it's not...terrible

#

but I miss so much stuff

hidden musk
#

๐Ÿคจ

cyan sleet
#

it's very basic, feels very C-like in that way

#

I very much miss generics

hidden musk
#

yeah. i mean, it is older by like 20 years

cyan sleet
#

I did end up making some macro terribleness to shorten some code

hazy ermine
#

man I wish I could play along

iron jewel
#

guys i need help

#

i mean a question

rancid creek
iron jewel
#

what is the language use to make this interface?

minor cave
honest nacelle
#

okay, taking a crack at today, wish me luck

#

I've given up on our private leaderboard for the moment, think it's healthier that way

low condor
zenith elbow
#

finally finished day 10 p2

#

completely missed that ||we're not just looking for . but also for pipes that aren't part of the path|| lemon_pensive

low condor
magic oxide
#

honestly it's a blessing that ||those pipes not part of the path also counted as spaces to check||

#

||otherwise pick wouldn't have worked||

edgy dirge
#

??

shadow musk
#

hola

hazy ermine
lusty rover
#

hola

rancid creek
lusty rover
#

como ce va?

#

or however you spell it

rancid creek
#

trouvรฉ et toi?

#

เคขเฅ‚เค‚เคขเฅ‡เค‚ เค”เคฐ เค†เคช?
ๆ‰พๅˆฐไบ†๏ผŒไฝ ๅ‘ข๏ผŸ

#

fun with google

hexed axle
#

how is it the 12th day already?

earnest forge
#

GL everyone

covert arrow
#

GLHF

zenith elbow
peak dock
royal gull
#

May you all get 12 lords a leaping

#

Or 12 drummers drumming

shut trellisBOT
magic oxide
#

bruh

#

I'm halfway up a mountain

minor cave
#

Language Roulette: Day 12
The language is ... PHP

magic oxide
#

lmao

tepid cairn
#

๐Ÿ˜ฉ

graceful dawn
#

I really need to get on these challenges, finals have been kicking my butt

covert arrow
#

||p1 is bruteforcable||

lapis prism
#

ping

jovial jay
hexed axle
#

solely based on the leaderboard, todays part 2 looks like a doozy

stable shale
#

Meanwhile I'm still trying to figure out whether to ||bruteforce|| P1 or try ||math|| (not really a spoiler, but just in case)

timber glacier
#

this is a confusing one what

#

I legit don't understand how to even get started

stable shale
#

Join the group of waiting for the leaderboard to fill so we can check Reddit

timber glacier
#

I just want hints not spoilers

stable shale
#

Yeah, read the hints some comments have, or pick a really confusing solution that you can't understand, and don't look too deep at it

hexed axle
#

Not the longest, but nearly 23 minutes to fill the leaderboard is pretty good

stable shale
#

P2 is gonna be horrifying, isn't it

minor cave
royal gull
#

Ok, this is a "I'm not solving this tonight, I'm going to bed" day.

stable shale
#

Smart

magic oxide
#

I was gonna do aoc at the top of the mountain

#

and then my Sim card ran out

covert arrow
#

ayy I'm back on the global lb

pine tiger
#

massive W

magic oxide
#

aren't onsens also hot springs

#

ohh I see

#

lmao

flat sequoia
#

Bro I'm trolling

#

idk why my code doesn't work

pine tiger
#

i thought you fullsolved already ๐Ÿ’€

flat sequoia
#

nop

#

I tried to do something clever

#

but it was wrong

#

so I wrote the dp

#

but it's not working

#

sobbing

#

i'm getting something ridiculously large ๐Ÿ˜ง

earnest forge
#

Finally got something that runs in reasonable time and works for the sample, but it doesn't work for my input

#

._.

#

Ok nvm I wrote a bad optimisation

#

573/983 oof