Day 5 | Advent of Code 2024

  Рет қаралды 4,502

Errichto Algorithms

Errichto Algorithms

Күн бұрын

Пікірлер: 12
@dharmanshah1239
@dharmanshah1239 7 күн бұрын
Hi errichto ..you probably dont recognize me but i used to write captions for you some 5 years back..good to see you back ...feels like 2019 again 😅
@siddharth-gandhi
@siddharth-gandhi 6 күн бұрын
unfortunate, they should have 2 leaderboards, one for ai and one for humans. thanks for great solutions! always learning new things from your approaches
@ameertaweel9278
@ameertaweel9278 6 күн бұрын
The out degree can be at most the number of characters - 1 (because there can't be a self-edge). It can be less, but can never be more. Therefore the solution you implemented is always better than the alternative you described.
@__Brandon__
@__Brandon__ 7 күн бұрын
You can do check if it's in the right order in linear time. Just define a less than comparator to be equal to if the rule (lhs,rhs) exisits in the rules set. Call std::is_sorted using your defined operator. Since checking each element is constant time since you are just checking if the rule exists, checking if everything is sorted is linear. And sorting them into the right order is also trivial, you just call std::sort with your custom less than operator. As long as you are using a stable sort you will get the right solution
@rastislavsvoboda4363
@rastislavsvoboda4363 6 күн бұрын
you are very good, I like watching your videos 14 sec looks crazy anyway, I guess simple bubble sort would do it or custom comparator #python res2 = 0 for bad in B: bad.sort(key=cmp_to_key(lambda p1, p2: -1 if p1 in D and p2 in D[p1] else 0)) res2 += bad[len(bad) // 2]
@michelemattioli219
@michelemattioli219 7 күн бұрын
In these two problems there were so many ambiguous things lol
@heinrich7521
@heinrich7521 7 күн бұрын
I agree, for part 2 it was never clearly stated that there could be more than 1 wrong ordering in a line of update.
@gala_vs
@gala_vs 7 күн бұрын
na its ai, a lot of them committed the code to some repo, i am not even trying for lb this year
@mohamedirfan2816
@mohamedirfan2816 7 күн бұрын
Yep, the leader-board has lost it's credibility, we don't know who is legit
@anubhabbhattacharya0710
@anubhabbhattacharya0710 7 күн бұрын
@@mohamedirfan2816 yes,solving just for fun now
@bladekiller2766
@bladekiller2766 7 күн бұрын
Yeah now it is pointless to compete for the leaderboard, everyone uses LLMs. But it's funny to me how you give the benefit of the doubt.
@sujals7108
@sujals7108 6 күн бұрын
The reason your assertion initially failed might be because you reached the end of the file so the string 's' didn't end with a newline character. So the index i was going out of bounds.
Day 6 | Advent of Code 2024
22:18
Errichto Algorithms
Рет қаралды 6 М.
Day 4 | Advent of Code 2024
9:18
Errichto Algorithms
Рет қаралды 3,1 М.
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 20 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 54 МЛН
Day 3 | Advent of Code 2024
13:58
Errichto Algorithms
Рет қаралды 8 М.
What Alex did with 53 seconds
12:51
Kay Lack
Рет қаралды 15 М.
Day 6 - Advent of Code 2024 (Solution)
17:46
James Peralta
Рет қаралды 1 М.
Why YOU Should Do Advent of Code
4:34
Theo - t3․gg
Рет қаралды 35 М.
Keynote: Advent of Code, Behind the Scenes - Eric Wastl
46:01
This Video is AI Generated! SORA Review
16:41
Marques Brownlee
Рет қаралды 3 МЛН
7 Design Patterns EVERY Developer Should Know
23:09
ForrestKnight
Рет қаралды 85 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 205 М.
Advent of Code 2024 | Day 06 "Guard Gallivant"
14:19
HyperNeutrino
Рет қаралды 2,7 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 767 М.
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 20 МЛН