-
-
Save darkash/c7622aa468b01b0b5c7301401e76f8e6 to your computer and use it in GitHub Desktop.
AoC 2020 (day 3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input = %w[..##....... | |
#...#...#.. | |
.#....#..#. | |
..#.#...#.# | |
.#...##..#. | |
..#.##..... | |
.#.#.#....# | |
.#........# | |
#.##...#... | |
#...##....# | |
.#..#...#.#] | |
input.select.with_index do |x, idx| | |
max = x.length | |
new_s = x * (idx * 3 / max + 1) | |
new_s[idx * 3] == "#" | |
end.count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment