Solving day 7 of Advent of Code 2021 in JavaScript

preview_player
Показать описание
Advent of Code is a website that releases a new programming puzzle every day between the 1st and the 25th of December.

0:00 Part 1
12:21 Part 2

Have fun!

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

Perhaps Math.floor() vs Math.round() in your first attempt at partB? Interesting discussion in the Reddit about the answer being tightly bounded but not fully determined by a simple calculation.

bikefixe
Автор

I had exactly the same issue as you on the second part xD. Just one question... whats the difference of using crabs.sort() as you just did on 21:07 and using it like crabs.sort((a, b) => a - b)? Because when I tried just crabs.sort() it didn't sort it out the way I expected. Thank you! Loving your series! =)

Alfiefaj
Автор

Another great video, thank you! Can you explain this like I'm 5 though? :D

xShosTaK