Advent of Code 2022 Day 11 (#4/#3) Walk-Through

preview_player
Показать описание

Please attempt the problem on your own before watching this video!
Рекомендации по теме
Комментарии
Автор

This is by far the clearest explanation of part two I've come across. Thanks!

TheFrogfather
Автор

I learned a lot of nice tricks while watching this!

random
Автор

You're very good at explaining something I'd have no clue about

milankovacs
Автор

Nice I didn't think about the eval(), wrote an operate() function instead that used if else statements and parsed the input before 😂

turboblitz
Автор

just a note for part 2:
if you're working with a statically typed language like c or c++, use int64_t instead of int, modular arithmetic isn't enough.

avi
Автор

I'm quite late for this (a year) but another solution that gets the job done infinitely quicker for part 2 is, before the monkey throws the item to the next, make the item the modulus of the LCM of all the divisibility tests.

hyperbolia-
Автор

The property is x % a = (x % (a * b)) % a

SqueezeWizard