Advent of Code 2021 - Day 7

preview_player
Показать описание
In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.

GitHub repository:

Unlock unlimited opportunities with 50% off your first month of Coursera Plus

Get on the fast track to a career in cybersecurity. In this certificate program, you'll learn in-demand skills, and get AI training from Google experts. Learn at your own pace, no degree or experience required.

Join the channel to get access to more perks:

Or visit my blog at:

Outro music: Sanaas Scylla

#aoc2021 #advent #code
Рекомендации по теме
Комментарии
Автор

I think the word you were trying to remember is _factorial_ ? But it's not what you wanted in this problem. You want the "sum of first n numbers", ie, 1+2+3+4+5+... which is (n * (n+1))/2

(factorial would be 5*4*3*2)

I always have to look up the formula, for some reason it never sticks in my head. After Day 6 this one was quite a change :)

aaronperl
Автор

These are called triangular numbers (1, 1+2, 1+2+3, etc).

VioletVal
Автор

I did the second solution using a rounded down mean. Can anyone tell me why I must use a ROUNDED DOWN mean instead of just a ROUNDED mean?

youtubeshortuser
Автор

Could you please hide file tree and terminal when you coding? :)

dany
Автор

can you please explain why you did what you did ?

kwakukusi