Advent of Code 2021 - Day 2Dive!

TypeScript | Problem statement | Source code | Tags: Grid walking

Part 1

The coordinates are a 2-element array [horizontal, depth], both starting at 0. We just iterate through each command and update the coordinates accordingly.

Part 2

We add an extra aim variable also starting at 0. down and up now modify aim.