Advent of Code Again??

Yes, but its 2020 question!

















Again, Thank you Mr Santa

















Problem 3 : Trees and something like free ski

AdventOfCode - Day 3

  1. You are given the following input:

    ..##.......
    #...#...#..
    .#....#..#.
    ..#.#...#.#
    .#...##..#.
    ..#.##.....
    .#.#.#....#
    .#........#
    #.##...#...
    #...##....#
    .#..#...#.#
    
  2. It wraps over and over again

    ..##.........##.......
    #...#...#..#...#...#..
    .#....#..#..#....#..#.
    ..#.#...#.#..#.#...#.#
    .#...##..#..#...##..#.
    ..#.##.......#.##..... ---- > repeats for ever!
    .#.#.#....#.#.#.#....#
    .#........#.#........#
    #.##...#...#.##...#...
    #...##....##...##....#
    .#..#...#.#.#..#...#.#
    
  3. We need to travel 3 right and 1 down and count how many trees we hit.

# = tree
. = snow

Example input

..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#

Note

  • You don't get the size.
















Typescript

S I M P L E

















Golang

S I M P L E

















Rust

Easy or hard depending on how you do it