├── day10
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day10.iml
└── src
│ └── day10
│ └── core.clj
├── day11
├── README.md
├── input
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day11.iml
└── spec
│ └── day11
│ └── core_spec.clj
├── day12
├── README.md
├── small-test-data
├── medium-test-data
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── large-test-data
├── input
├── project.clj
├── day12.iml
└── src
│ └── day12
│ └── core.clj
├── day13
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── sample
├── project.clj
├── spec
│ └── day13
│ │ └── core_spec.clj
├── day13.iml
└── src
│ └── day13
│ └── core.clj
├── day14
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── sample
├── project.clj
├── input
├── day14.iml
└── spec
│ └── day14
│ └── core_spec.clj
├── day15
├── README.md
├── sample
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day15.iml
└── samplex5
├── day16
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── input
├── day16.iml
└── spec
│ └── day16
│ └── core_spec.clj
├── day17
├── README.md
├── input
├── sample
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day17.iml
├── src
│ └── day17
│ │ └── core.clj
└── spec
│ └── day17
│ └── core_spec.clj
├── day18
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ ├── Leiningen__clojure_complete_0_2_5.xml
│ │ └── Leiningen__org_clojure_math_combinatorics_0_1_6.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── sample
├── project.clj
└── day18.iml
├── day19
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ ├── Leiningen__org_flatland_ordered_1_15_10.xml
│ │ ├── Leiningen__clojure_complete_0_2_5.xml
│ │ └── Leiningen__org_clojure_math_combinatorics_0_1_6.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day19.iml
└── sample
├── day20
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── sample
├── day20.iml
├── spec
│ └── day20
│ │ └── core_spec.clj
└── src
│ └── day20
│ └── core.clj
├── day4
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── vcs.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day4.iml
└── src
│ └── day4
│ └── core.clj
├── day5
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day5.iml
├── spec
│ └── day5
│ │ └── core_spec.clj
└── src
│ └── day5
│ └── core.clj
├── day6
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── input
├── src
│ └── day6
│ │ └── core.clj
├── spec
│ └── day6
│ │ └── core_spec.clj
└── day6.iml
├── day7
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── spec
│ └── day7
│ │ └── core_spec.clj
├── src
│ └── day7
│ │ └── core.clj
└── day7.iml
├── day8
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
└── day8.iml
├── day9
├── README.md
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── .gitignore
│ ├── ClojureProjectResolveSettings.xml
│ ├── modules.xml
│ ├── libraries
│ │ ├── Leiningen__fresh_1_1_2.xml
│ │ ├── Leiningen__nrepl_0_6_0.xml
│ │ ├── Leiningen__mmargs_1_2_0.xml
│ │ ├── Leiningen__speclj_3_3_2.xml
│ │ ├── Leiningen__org_clojure_clojure_1_8_0.xml
│ │ ├── Leiningen__trptcolin_versioneer_0_1_1.xml
│ │ └── Leiningen__clojure_complete_0_2_5.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── misc.xml
│ └── compiler.xml
├── project.clj
├── day9.iml
├── spec
│ └── day9
│ │ └── core_spec.clj
└── src
│ └── day9
│ └── core.clj
└── README.md
/day10/README.md:
--------------------------------------------------------------------------------
1 | # day10
2 |
--------------------------------------------------------------------------------
/day11/README.md:
--------------------------------------------------------------------------------
1 | # day11
2 |
--------------------------------------------------------------------------------
/day12/README.md:
--------------------------------------------------------------------------------
1 | # day12
2 |
--------------------------------------------------------------------------------
/day13/README.md:
--------------------------------------------------------------------------------
1 | # day13
2 |
--------------------------------------------------------------------------------
/day14/README.md:
--------------------------------------------------------------------------------
1 | # day14
2 |
--------------------------------------------------------------------------------
/day15/README.md:
--------------------------------------------------------------------------------
1 | # day15
2 |
--------------------------------------------------------------------------------
/day16/README.md:
--------------------------------------------------------------------------------
1 | # day16
2 |
--------------------------------------------------------------------------------
/day17/README.md:
--------------------------------------------------------------------------------
1 | # day17
2 |
--------------------------------------------------------------------------------
/day18/README.md:
--------------------------------------------------------------------------------
1 | # day18
2 |
--------------------------------------------------------------------------------
/day19/README.md:
--------------------------------------------------------------------------------
1 | # day19
2 |
--------------------------------------------------------------------------------
/day20/README.md:
--------------------------------------------------------------------------------
1 | # day20
2 |
--------------------------------------------------------------------------------
/day4/README.md:
--------------------------------------------------------------------------------
1 | # day4
2 |
--------------------------------------------------------------------------------
/day5/README.md:
--------------------------------------------------------------------------------
1 | # day5
2 |
--------------------------------------------------------------------------------
/day6/README.md:
--------------------------------------------------------------------------------
1 | # day6
2 |
--------------------------------------------------------------------------------
/day7/README.md:
--------------------------------------------------------------------------------
1 | # day7
2 |
--------------------------------------------------------------------------------
/day8/README.md:
--------------------------------------------------------------------------------
1 | # day8
2 |
--------------------------------------------------------------------------------
/day9/README.md:
--------------------------------------------------------------------------------
1 | # day9
2 |
--------------------------------------------------------------------------------
/day17/input:
--------------------------------------------------------------------------------
1 | target area: x=207..263, y=-115..-63
2 |
--------------------------------------------------------------------------------
/day17/sample:
--------------------------------------------------------------------------------
1 | target area: x=20..30, y=-10..-5
2 |
--------------------------------------------------------------------------------
/day12/small-test-data:
--------------------------------------------------------------------------------
1 | start-A
2 | start-b
3 | A-c
4 | A-b
5 | b-d
6 | A-end
7 | b-end
8 |
--------------------------------------------------------------------------------
/day12/medium-test-data:
--------------------------------------------------------------------------------
1 | dc-end
2 | HN-start
3 | start-kj
4 | dc-start
5 | dc-HN
6 | LN-dc
7 | HN-end
8 | kj-sa
9 | kj-HN
10 | kj-dc
11 |
--------------------------------------------------------------------------------
/day11/input:
--------------------------------------------------------------------------------
1 | 2238518614
2 | 4552388553
3 | 2562121143
4 | 2666685337
5 | 7575518784
6 | 3572534871
7 | 8411718283
8 | 7742668385
9 | 1235133231
10 | 2546165345
--------------------------------------------------------------------------------
/day15/sample:
--------------------------------------------------------------------------------
1 | 1163751742
2 | 1381373672
3 | 2136511328
4 | 3694931569
5 | 7463417111
6 | 1319128137
7 | 1359912421
8 | 3125421639
9 | 1293138521
10 | 2311944581
11 |
--------------------------------------------------------------------------------
/day10/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day11/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day12/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day13/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day14/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day15/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day16/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day17/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day18/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day19/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day20/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day4/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day5/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day6/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day7/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day8/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day9/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /lib
3 | /classes
4 | /checkouts
5 | pom.xml
6 | *.jar
7 | *.class
8 | .lein-deps-sum
9 | .lein-failures
10 | .lein-plugins
11 | .lein-repl-history
12 |
--------------------------------------------------------------------------------
/day4/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day5/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day6/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day7/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day8/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day9/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day10/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day11/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day12/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day13/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day14/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day15/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day16/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day17/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day18/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day19/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day20/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day10/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day11/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day12/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day13/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day14/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day15/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day16/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day17/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day18/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day19/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day20/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day9/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day5/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day6/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day7/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day8/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day10/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day11/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day12/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day12/large-test-data:
--------------------------------------------------------------------------------
1 | fs-end
2 | he-DX
3 | fs-he
4 | start-DX
5 | pj-DX
6 | end-zg
7 | zg-sl
8 | zg-pj
9 | pj-he
10 | RW-he
11 | fs-DX
12 | pj-RW
13 | zg-RW
14 | start-pj
15 | he-WI
16 | zg-he
17 | pj-fs
18 | start-RW
19 |
--------------------------------------------------------------------------------
/day13/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day13/sample:
--------------------------------------------------------------------------------
1 | 6,10
2 | 0,14
3 | 9,10
4 | 0,3
5 | 10,4
6 | 4,11
7 | 6,0
8 | 6,12
9 | 4,1
10 | 0,13
11 | 10,12
12 | 3,4
13 | 3,0
14 | 8,4
15 | 1,10
16 | 2,14
17 | 8,10
18 | 9,0
19 |
20 | fold along y=7
21 | fold along x=5
22 |
--------------------------------------------------------------------------------
/day14/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day15/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day16/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day17/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day18/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day19/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day20/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day4/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day5/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day6/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day7/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day8/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day9/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/day14/sample:
--------------------------------------------------------------------------------
1 | NNCB
2 |
3 | CH -> B
4 | HH -> N
5 | CB -> H
6 | NH -> C
7 | HB -> C
8 | HC -> B
9 | HN -> C
10 | NN -> C
11 | BH -> H
12 | NC -> B
13 | NB -> B
14 | BN -> B
15 | BB -> N
16 | BC -> B
17 | CC -> N
18 | CN -> C
19 |
--------------------------------------------------------------------------------
/day10/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day11/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day12/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day13/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day14/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day15/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day16/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day17/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day18/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day19/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day20/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day4/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day5/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day6/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day7/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day8/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day9/.idea/ClojureProjectResolveSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IDE
5 |
6 |
--------------------------------------------------------------------------------
/day12/input:
--------------------------------------------------------------------------------
1 | OU-xt
2 | hq-xt
3 | br-HP
4 | WD-xt
5 | end-br
6 | start-OU
7 | hq-br
8 | MH-hq
9 | MH-start
10 | xt-br
11 | end-WD
12 | hq-start
13 | MH-br
14 | qw-OU
15 | hm-WD
16 | br-WD
17 | OU-hq
18 | xt-MH
19 | qw-MH
20 | WD-qw
21 | end-qw
22 | qw-xt
23 |
--------------------------------------------------------------------------------
/day4/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/day4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day5/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day6/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day7/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day8/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day9/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day10/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day11/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day12/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day13/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day14/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day15/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day16/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day17/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day18/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day19/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day20/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__fresh_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__nrepl_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day10/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__mmargs_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__speclj_3_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__org_clojure_clojure_1_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__trptcolin_versioneer_0_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__org_flatland_ordered_1_15_10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day10/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day11/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day12/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day13/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day14/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day15/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day16/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day17/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day20/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day4/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day5/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day6/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day7/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day8/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day9/.idea/libraries/Leiningen__clojure_complete_0_2_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Advent of Code 2021.
2 |
3 | The first three days were throwaways. No code for them.
4 | Every other day shows the final result.
5 |
6 | The testing library is 'speclj'. You'll see it referenced in project.clj.
7 | The java version is 1.8.
8 |
9 | As requested by the AOC team, I'll be adding solutions a few days behind, just to keep things "fair".
10 |
--------------------------------------------------------------------------------
/day18/.idea/libraries/Leiningen__org_clojure_math_combinatorics_0_1_6.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day19/.idea/libraries/Leiningen__org_clojure_math_combinatorics_0_1_6.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/day18/sample:
--------------------------------------------------------------------------------
1 | [[[0,[5,8]],[[1,7],[9,6]]],[[4,[1,2]],[[1,4],2]]]
2 | [[[5,[2,8]],4],[5,[[9,9],0]]]
3 | [6,[[[6,2],[5,6]],[[7,6],[4,7]]]]
4 | [[[6,[0,7]],[0,9]],[4,[9,[9,0]]]]
5 | [[[7,[6,4]],[3,[1,3]]],[[[5,5],1],9]]
6 | [[6,[[7,3],[3,2]]],[[[3,8],[5,7]],4]]
7 | [[[[5,4],[7,7]],8],[[8,3],8]]
8 | [[9,3],[[9,9],[6,[4,9]]]]
9 | [[2,[[7,7],7]],[[5,8],[[9,3],[0,2]]]]
10 | [[[[5,2],5],[8,[3,7]]],[[5,[7,5]],[4,4]]]
11 |
--------------------------------------------------------------------------------
/day4/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day4 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day4.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day5/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day5 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day5.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day6/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day6 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day6.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day7/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day7 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day7.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day8/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day8 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day8.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day9/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day9 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day9.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day10/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day10 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day10.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day11/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day11 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day11.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day12/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day12 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day12.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day13/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day13 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day13.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day14/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day14 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day14.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day15/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day15 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day15.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day16/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day16 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day16.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day17/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day17 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day17.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day20/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day20 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day20.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]]
8 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
9 | :plugins [[speclj "3.3.2"]]
10 | :test-paths ["spec"])
11 |
--------------------------------------------------------------------------------
/day18/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day18 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day18.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]
8 | [org.clojure/math.combinatorics "0.1.6"]]
9 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
10 | :plugins [[speclj "3.3.2"]]
11 | :test-paths ["spec"])
12 |
--------------------------------------------------------------------------------
/day4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day5/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day6/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day7/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day8/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day9/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day10/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day11/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day12/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day13/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day14/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day15/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day16/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day17/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day18/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day19/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day20/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/day19/project.clj:
--------------------------------------------------------------------------------
1 | (defproject day19 "0.1.0-SNAPSHOT"
2 | :description "FIXME: write description"
3 | :url "http://example.com/FIXME"
4 | :license {:name "Eclipse Public License"
5 | :url "http://www.eclipse.org/legal/epl-v10.html"}
6 | :main day19.core
7 | :dependencies [[org.clojure/clojure "1.8.0"]
8 | [org.flatland/ordered "1.15.10"]
9 | [org.clojure/math.combinatorics "0.1.6"]]
10 | :profiles {:dev {:dependencies [[speclj "3.3.2"]]}}
11 | :plugins [[speclj "3.3.2"]]
12 | :test-paths ["spec"])
13 |
--------------------------------------------------------------------------------
/day20/sample:
--------------------------------------------------------------------------------
1 | ..#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..###..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###.######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#..#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#......#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#.....####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.......##..####..#...#.#.#...##..#.#..###..#####........#..####......#..#
2 |
3 | #..#.
4 | #....
5 | ##..#
6 | ..#..
7 | ..###
8 |
--------------------------------------------------------------------------------
/day6/input:
--------------------------------------------------------------------------------
1 | 5,3,2,2,1,1,4,1,5,5,1,3,1,5,1,2,1,4,1,2,1,2,1,4,2,4,1,5,1,3,5,4,3,3,1,4,1,3,4,4,1,5,4,3,3,2,5,1,1,3,1,4,3,2,2,3,1,3,1,3,1,5,3,5,1,3,1,4,2,1,4,1,5,5,5,2,4,2,1,4,1,3,5,5,1,4,1,1,4,2,2,1,3,1,1,1,1,3,4,1,4,1,1,1,4,4,4,1,3,1,3,4,1,4,1,2,2,2,5,4,1,3,1,2,1,4,1,4,5,2,4,5,4,1,2,1,4,2,2,2,1,3,5,2,5,1,1,4,5,4,3,2,4,1,5,2,2,5,1,4,1,5,1,3,5,1,2,1,1,1,5,4,4,5,1,1,1,4,1,3,3,5,5,1,5,2,1,1,3,1,1,3,2,3,4,4,1,5,5,3,2,1,1,1,4,3,1,3,3,1,1,2,2,1,2,2,2,1,1,5,1,2,2,5,2,4,1,1,2,4,1,2,3,4,1,2,1,2,4,2,1,1,5,3,1,4,4,4,1,5,2,3,4,4,1,5,1,2,2,4,1,1,2,1,1,1,1,5,1,3,3,1,1,1,1,4,1,2,2,5,1,2,1,3,4,1,3,4,3,3,1,1,5,5,5,2,4,3,1,4
2 |
3 |
--------------------------------------------------------------------------------
/day10/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day11/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day12/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day13/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day14/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day15/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day16/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day17/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day18/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day19/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day20/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day4/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day5/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day6/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day7/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day8/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day9/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/day6/src/day6/core.clj:
--------------------------------------------------------------------------------
1 | (ns day6.core)
2 |
3 | (defn parse-input [input]
4 | (let [fish-list (map #(Integer/parseInt %)
5 | (clojure.string/split input #","))
6 | ]
7 | (loop [school []
8 | age 0]
9 | (if (= 10 age)
10 | school
11 | (let [fish-of-age (count (filter #(= age %) fish-list))]
12 | (recur (conj school fish-of-age)
13 | (inc age)))))
14 | ))
15 |
16 | (defn age-fish [school]
17 | (conj (vec (rest school)) 0))
18 |
19 | (defn count-births [school]
20 | (first school))
21 |
22 | (defn reproduce [school]
23 | (let [births (count-births school)
24 | [a b c d e f g h i j] school]
25 | [a b c d e f g (+ births h) i (+ births j)]))
26 |
27 | (defn day [school]
28 | (-> school reproduce age-fish))
29 |
30 | (defn solve-1 [input days]
31 | (let [school (parse-input input)
32 | school (nth (iterate day school) days)]
33 | (reduce + school)))
--------------------------------------------------------------------------------
/day7/spec/day7/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day7.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day7.core :refer :all]))
4 |
5 |
6 | (describe "parse input"
7 | (it "parses the input"
8 | (should= [1 2 3] (parse-input "1,2,3\n"))))
9 |
10 | (describe "utilities"
11 | (it "should calculate mean"
12 | (should= 2 (mean [1 2 3])))
13 |
14 | (it "should find distances from a point"
15 | (should= [1 0 1] (distances 2 [1 2 3])))
16 |
17 | (it "should find the sum of distances from a point"
18 | (should= 2 (sum-distances 2 [1 2 3])))
19 |
20 | (it "should calculate cost of movement for part 2"
21 | (should= 5050 (cost-2 100)))
22 |
23 | )
24 |
25 | (def sample "16,1,2,0,4,2,7,1,2,14")
26 |
27 | (describe "part 1"
28 | (it "should solve sample"
29 | (should= 37 (solve-1 sample)))
30 |
31 | (it "should solve problem"
32 | (should= 359648 (solve-1 (slurp "input"))))
33 | )
34 |
35 | (describe "part 2"
36 | (it "should solve sample"
37 | (should= 168 (solve-2 sample)))
38 |
39 | (it "should solve prolem"
40 | (should= 100727924 (solve-2 (slurp "input")))))
41 |
--------------------------------------------------------------------------------
/day7/src/day7/core.clj:
--------------------------------------------------------------------------------
1 | (ns day7.core)
2 |
3 | (defn parse-input [input]
4 | (let [input (.trim input)
5 | input (clojure.string/split input #",")]
6 | (map #(Integer/parseInt %) input)))
7 |
8 | (defn mean [ns]
9 | (/ (reduce + ns) (count ns)))
10 |
11 | (defn- abs [n]
12 | (if (neg? n) (- n) n))
13 |
14 | (defn distances [p ns]
15 | (map #(abs (- p %)) ns))
16 |
17 | (defn sum-distances [p ns]
18 | (reduce + (distances p ns)))
19 |
20 | (defn cost-2 [n]
21 | (/ (+ n (* n n)) 2))
22 |
23 | (defn sum-cost-2 [p ns]
24 | (reduce + (map cost-2 (distances p ns))))
25 |
26 | (defn solve-1 [input]
27 | (let [input (parse-input input)
28 | start (apply min input)
29 | stop (apply max input)
30 | trials (map #(sum-distances % input)
31 | (range start (inc stop)))]
32 | (apply min trials)))
33 |
34 | (defn solve-2 [input]
35 | (let [input (parse-input input)
36 | start (apply min input)
37 | stop (apply max input)
38 | trials (map #(sum-cost-2 % input)
39 | (range start (inc stop)))]
40 | (apply min trials)))
41 |
--------------------------------------------------------------------------------
/day6/spec/day6/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day6.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day6.core :refer :all]))
4 |
5 | (describe "can parse input"
6 | (it "can parse input"
7 | (should= [0 1 1 1 0 0 0 0 0 0] (parse-input "1,2,3"))))
8 |
9 | (describe "growth of population"
10 | (it "counts ages down"
11 | (should= [3 5 7 1 3 6 2 5 1 0] (age-fish [1 3 5 7 1 3 6 2 5 1])))
12 |
13 | (it "counts births"
14 | (should= 1 (count-births [1 2 0 4 0 5])))
15 |
16 | (it "reproduces"
17 | (should= [3 9 7 4 2 1 7 9 3 12] (reproduce [3 9 7 4 2 1 7 6 3 9])))
18 |
19 | (it "does a day"
20 | (should= [5 7 6 8 2 4 6 7 10 0] (day [1 5 7 6 8 2 4 5 7 9])))
21 | )
22 |
23 |
24 | (def sample "3,4,3,1,2")
25 |
26 | (describe "part 1"
27 | (it "should solve sample"
28 | (should= 5934 (solve-1 sample 80)))
29 |
30 | (it "should solve problem"
31 | (should= 359999 (solve-1 (.trim (slurp "input")) 80)))
32 | )
33 |
34 | (describe "part 2"
35 | (it "should solve sample"
36 | (should= 26984457539 (solve-1 sample 256)))
37 |
38 | (it "should solve problem"
39 | (should= 1631647919273 (solve-1 (.trim (slurp "input")) 256))))
40 |
--------------------------------------------------------------------------------
/day16/input:
--------------------------------------------------------------------------------
1 | 8054F9C95F9C1C973D000D0A79F6635986270B054AE9EE51F8001D395CCFE21042497E4A2F6200E1803B0C20846820043630C1F8A840087C6C8BB1688018395559A30997A8AE60064D17980291734016100622F41F8DC200F4118D3175400E896C068E98016E00790169A600590141EE0062801E8041E800F1A0036C28010402CD3801A60053007928018CA8014400EF2801D359FFA732A000D2623CADE7C907C2C96F5F6992AC440157F002032CE92CE9352AF9F4C0119BDEE93E6F9C55D004E66A8B335445009E1CCCEAFD299AA4C066AB1BD4C5804149C1193EE1967AB7F214CF74752B1E5CEDC02297838C649F6F9138300424B9C34B004A63CCF238A56B71520142A5A7FC672E5E00B080350663B44F1006A2047B8C51CC80286C0055253951F98469F1D86D3C1E600F80021118A124261006E23C7E8260008641A8D51F0C01299EC3F4B6A37CABD80252211221A600BC930D0057B2FAA31CDCEF6B76DADF1666FE2E000FA4905CB7239AFAC0660114B39C9BA492D4EBB180252E472AD6C00BF48C350F9F47D2012B6C014000436284628BE00087C5D8671F27F0C480259C9FE16D1F4B224942B6F39CAF767931CFC36BC800EA4FF9CE0CCE4FCA4600ACCC690DE738D39D006A000087C2A89D0DC401987B136259006AFA00ACA7DBA53EDB31F9F3DBF31900559C00BCCC4936473A639A559BC433EB625404300564D67001F59C8E3172892F498C802B1B0052690A69024F3C95554C0129484C370010196269D071003A079802DE0084E4A53E8CCDC2CA7350ED6549CEC4AC00404D3C30044D1BA78F25EF2CFF28A60084967D9C975003992DF8C240923C45300BE7DAA540E6936194E311802D800D2CB8FC9FA388A84DEFB1CB2CBCBDE9E9C8803A6B00526359F734673F28C367D2DE2F3005256B532D004C40198DF152130803D11211C7550056706E6F3E9D24B0
2 |
--------------------------------------------------------------------------------
/day13/spec/day13/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day13.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day13.core :refer :all]))
4 |
5 | (describe "parsing"
6 | (it "parses a line"
7 | (should= [[] []] (parse-line ""))
8 | (should= [[5 6] []] (parse-line "5,6"))
9 | (should= [[] [0 7]] (parse-line "fold along y=7"))
10 | (should= [[] [5 0]] (parse-line "fold along x=5")))
11 |
12 | (it "parses many lines"
13 | (should= {:coords #{[1 2] [3 4]}
14 | :folds [[0 7] [5 0]]}
15 | (parse-input "1,2\n3,4\nfold along y=7\nfold along x=5\n")))
16 | )
17 |
18 | (describe "utilities"
19 | (it "folds"
20 | (should= #{} (fold #{} [0 0]))
21 | (should= #{[1 1]} (fold #{[1 1]} [0 1]))
22 | (should= #{[1 0] [2 1] [2 2]}
23 | (fold #{[1 0] [2 1] [2 4] [2 5]} [0 3]))
24 |
25 | (should= #{[0 0] [1 1] [0 2]}
26 | (fold #{[0 0] [1 1] [3 1] [4 2]}
27 | [2 0]))
28 | )
29 | )
30 |
31 | (describe "solutions"
32 | (context "part 1"
33 | (it "should solve sample"
34 | (should= 17 (solve-1 (slurp "sample"))))
35 |
36 | (it "should solve problem"
37 | (should= 763 (solve-1 (slurp "input")))))
38 |
39 | (context "part 2"
40 | (it "folds the problem"
41 | (let [answer (solve-2 (slurp "input"))]
42 | (draw answer)
43 | )))
44 | )
45 |
--------------------------------------------------------------------------------
/day14/input:
--------------------------------------------------------------------------------
1 | CPSSSFCFOFVFNVPKBFVN
2 |
3 | NV -> V
4 | CF -> O
5 | BB -> F
6 | SB -> H
7 | KF -> O
8 | SP -> H
9 | CS -> V
10 | VF -> F
11 | PC -> H
12 | PH -> H
13 | SF -> F
14 | CP -> B
15 | BC -> H
16 | PB -> V
17 | KO -> B
18 | CV -> S
19 | ON -> B
20 | PV -> F
21 | OO -> B
22 | VV -> B
23 | NO -> B
24 | SH -> N
25 | FC -> C
26 | VO -> B
27 | NN -> C
28 | HH -> S
29 | CK -> C
30 | PF -> N
31 | SN -> K
32 | OK -> F
33 | FH -> S
34 | BP -> K
35 | HO -> K
36 | FB -> P
37 | HC -> N
38 | FP -> P
39 | NC -> H
40 | PK -> O
41 | BV -> P
42 | HK -> S
43 | PP -> N
44 | VC -> K
45 | CH -> C
46 | KS -> V
47 | KB -> V
48 | FN -> P
49 | BS -> O
50 | PS -> N
51 | NS -> B
52 | PN -> N
53 | NP -> H
54 | CB -> S
55 | SV -> O
56 | OC -> H
57 | BO -> C
58 | HN -> N
59 | HP -> N
60 | OF -> H
61 | FS -> S
62 | KV -> P
63 | HV -> S
64 | VS -> P
65 | BH -> N
66 | CC -> V
67 | VN -> H
68 | NF -> B
69 | NK -> N
70 | CN -> F
71 | FV -> P
72 | NH -> S
73 | OV -> H
74 | KN -> F
75 | SO -> H
76 | OP -> N
77 | KC -> P
78 | HB -> B
79 | BN -> V
80 | VP -> N
81 | HS -> S
82 | VK -> C
83 | VH -> H
84 | OS -> C
85 | FO -> B
86 | NB -> P
87 | KP -> V
88 | SS -> O
89 | BK -> F
90 | SK -> N
91 | HF -> O
92 | PO -> F
93 | OH -> B
94 | KK -> O
95 | FK -> S
96 | VB -> V
97 | OB -> C
98 | KH -> H
99 | SC -> F
100 | FF -> H
101 | CO -> V
102 | BF -> H
103 |
--------------------------------------------------------------------------------
/day4/day4.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day5/day5.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day6/day6.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day7/day7.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day8/day8.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day9/day9.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day10/day10.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day11/day11.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day12/day12.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day13/day13.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day14/day14.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day15/day15.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day16/day16.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day17/day17.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day20/day20.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/day10/src/day10/core.clj:
--------------------------------------------------------------------------------
1 | (ns day10.core)
2 |
3 | (defn parse-input [input]
4 | (clojure.string/split-lines input))
5 |
6 | (defn closer-for [c]
7 | (condp = c
8 | \( \)
9 | \[ \]
10 | \{ \}
11 | \< \>
12 | nil))
13 |
14 | (defn opener? [c]
15 | (or
16 | (= \( c)
17 | (= \{ c)
18 | (= \[ c)
19 | (= \< c)))
20 |
21 | (defn corrupt [c]
22 | (condp = c
23 | \) :bad-p
24 | \] :bad-b
25 | \} :bad-c
26 | \> :bad-a))
27 |
28 |
29 | (defn parse-chunk [s]
30 | (loop [s s
31 | c (list)]
32 | (cond
33 | (empty? s)
34 | (apply str c)
35 |
36 | (opener? (first s))
37 | (recur (rest s) (conj c (closer-for (first s))))
38 |
39 | (= (first s) (first c))
40 | (recur (rest s) (rest c))
41 |
42 | :else
43 | (corrupt (first s)))))
44 |
45 | (defn score [c]
46 | (condp = c
47 | :bad-p 3
48 | :bad-b 57
49 | :bad-c 1197
50 | :bad-a 25137
51 | 0))
52 |
53 | (defn score-2 [c]
54 | (condp = c
55 | \) 1
56 | \] 2
57 | \} 3
58 | \> 4)
59 | )
60 |
61 | (defn- score-completion [c]
62 | (let [scores (map score-2 c)]
63 | (reduce #(+ (* 5 %1) %2) scores)))
64 |
65 | (defn solve-1 [input]
66 | (let [input (parse-input input)
67 | results (map parse-chunk input)
68 | scores (map score results)]
69 | (reduce + scores)))
70 |
71 | (defn- incomplete? [s]
72 | (and
73 | (not (keyword? s))
74 | (not (empty? s))))
75 |
76 | (defn solve-2 [input]
77 | (let [input (parse-input input)
78 | completions (filter incomplete? (map parse-chunk input))
79 | scores (map score-completion completions)
80 | n-scores (count scores)]
81 | (nth (sort scores) (quot n-scores 2))))
--------------------------------------------------------------------------------
/day18/day18.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/day19/day19.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/day5/spec/day5/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day5.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day5.core :refer :all]))
4 | (def sample "0,9 -> 5,9\n8,0 -> 0,8\n9,4 -> 3,4\n2,2 -> 2,1\n7,0 -> 7,4\n6,4 -> 2,0\n0,9 -> 2,9\n3,4 -> 1,4\n0,0 -> 8,8\n5,5 -> 8,2\n")
5 |
6 | (describe "parsing input"
7 | (it "should parse one line"
8 | (should= [[1 2] [3 4]]
9 | (parse-line "1,2 -> 3,4\n")))
10 |
11 | (it "should parse many lines"
12 | (should= [[[1 2] [3 4]] [[5 6] [7 8]]]
13 | (parse-lines "1,2 -> 3,4\n5,6 -> 7,8\n")))
14 | )
15 |
16 | (describe "utilities"
17 | (it "should find the unit vector"
18 | (should= [0 0] (unit-vector [[1 1] [1 1]]))
19 | (should= [1 1] (unit-vector [[1 2] [5 6]]))
20 | (should= [-1 -1] (unit-vector [[5 6] [1 2]]))
21 | (should= [1 0] (unit-vector [[1 2] [5 2]]))
22 | (should= [0 -1] (unit-vector [[5 6] [5 2]]))
23 | )
24 |
25 | (it "should add vectors to points"
26 | (should= [3 4] (add-vector [1 1] [2 3])))
27 |
28 | (it "should find points on line"
29 | (should= #{[1 1] [2 2] [3 3]}
30 | (points-on-line [[1 1] [3 3]]))
31 | (should= #{[1 1] [2 2] [3 3]}
32 | (points-on-line [[3 3] [1 1]]))
33 | (should= #{[1 1]}
34 | (points-on-line [[1 1] [1 1]]))
35 | )
36 |
37 | (it "should accumulate points"
38 | (should= {[1 1] 1}
39 | (accumulate-points [#{[1 1]}]))
40 | (should= {[1 1] 2 [2 2] 2 [3 3] 1}
41 | (accumulate-points [#{[1 1] [2 2]}
42 | #{[1 1] [2 2] [3 3]}]))
43 |
44 | )
45 |
46 | (it "should solve sample part 1"
47 | (should= 5 (solve-1 sample)))
48 |
49 | (it "should solve part 1"
50 | (should= 7269 (solve-1 (slurp "input"))))
51 |
52 | (it "should solve sample part 2"
53 | (should= 12 (solve-2 sample)))
54 |
55 | (it "should solve part 2"
56 | (should= 21140 (solve-2 (slurp "input"))))
57 | )
58 |
--------------------------------------------------------------------------------
/day17/src/day17/core.clj:
--------------------------------------------------------------------------------
1 | (ns day17.core)
2 |
3 | (defn parse-input [input]
4 | (let [ns (re-seq #"[-]?\d+" input)]
5 | (map #(Integer/parseInt %) ns)))
6 |
7 | (defn in? [[min-x max-x min-y max-y] [x y]]
8 | (and
9 | (>= x min-x)
10 | (<= x max-x)
11 | (>= y min-y)
12 | (<= y max-y)))
13 |
14 | (defn beyond? [[min-x max-x min-y max-y] [x y]]
15 | (or
16 | (> x max-x)
17 | (< y min-y)))
18 |
19 | (defn max-vx [[min-x max-x min-y max-y]]
20 | (inc max-x))
21 |
22 | (defn min-v [dist]
23 | (let [d (Math/sqrt (+ 1 (* 8 dist)))
24 | v (/ (- d 1) 2)]
25 | (int v)))
26 |
27 | (defn min-vx [[min-x max-x min-y max-y]]
28 | (min-v min-x))
29 |
30 | (defn min-vy [[min-x max-x min-y max-y]]
31 | 0)
32 |
33 | (defn max-vy [[min-x max-x min-y max-y]]
34 | (Math/abs ^int (dec min-y)))
35 |
36 | (defn shot [box [vx vy]]
37 | (loop [p [0 0]
38 | vx vx
39 | vy vy
40 | h 0]
41 | (cond
42 | (beyond? box p)
43 | :miss
44 |
45 | (in? box p)
46 | h
47 |
48 | :else
49 | (let [h (max h (second p))
50 | p [(+ vx (first p))
51 | (+ vy (second p))]
52 | vx (max 0 (dec vx))
53 | vy (dec vy)
54 | ]
55 | (recur p vx vy h)))))
56 |
57 | (defn solve-1 [input]
58 | (let [box (parse-input input)
59 | vx-range (range (min-vx box) (inc (max-vx box)))
60 | vy-range (range (min-vy box) (inc (max-vy box)))
61 | heights (for [vx vx-range vy vy-range]
62 | (shot box [vx vy]))
63 | heights (remove #(= :miss %) heights)]
64 | (apply max heights)))
65 |
66 | (defn solve-2 [input]
67 | (let [box (parse-input input)
68 | vx-range (range (min-vx box) (inc (max-vx box)))
69 | max-vy (inc (max-vy box))
70 | vy-range (range (- max-vy) max-vy)
71 | heights (for [vx vx-range vy vy-range]
72 | (shot box [vx vy]))
73 | heights (remove #(= :miss %) heights)]
74 | (count heights)))
--------------------------------------------------------------------------------
/day20/spec/day20/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day20.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day20.core :refer :all]))
4 |
5 | (describe "parsing"
6 | (it "parses initial image"
7 | (should= {[0 0] \.
8 | [1 0] \#
9 | [2 0] \.
10 | [0 1] \#
11 | [1 1] \.
12 | [2 1] \#}
13 | (parse-image [".#."
14 | "#.#"]))))
15 |
16 |
17 | (describe "utilities"
18 | (it "finds bounding rectangle"
19 | (should= [[0 0] [2 1]]
20 | (bounds (parse-image [".#."
21 | "#.#"]))))
22 |
23 | (it "expands bounds"
24 | (should= [[-1 -1] [3 2]]
25 | (expand-box (bounds (parse-image [".#."
26 | "#.#"])))))
27 |
28 | (it "computes neighbors"
29 | (should= [[-1 -1] [0 -1] [1 -1]
30 | [-1 0] [0 0] [1 0]
31 | [-1 1] [0 1] [1 1]]
32 | (neighbors-of [0 0])))
33 |
34 | (it "finds the binary index"
35 | (let [image (parse-image [".#."
36 | "#.#"])]
37 | (should= 168 (binary-index-of image [1 1]))))
38 |
39 | (it "finds the binary index from sample"
40 | (let [image (parse-image ["#..#."
41 | "#...."
42 | "##..#"
43 | "..#.."
44 | "..###"])]
45 | (should= 1 (binary-index-of image [-1 -1]))
46 | (should= 9 (binary-index-of image [-1 0]))
47 | (should= 73 (binary-index-of image [-1 1])))))
48 |
49 | (describe "solutions"
50 | (context "part 1"
51 | (it "solves sample"
52 | (should= 35 (solve (slurp "sample") 2)))
53 |
54 | (it "solves problem"
55 | (should= 5065 (solve (slurp "input") 2))))
56 |
57 | (context "part 2"
58 | (it "solves sample"
59 | (should= 3351 (solve (slurp "sample") 50)))
60 |
61 | (it "solves problem"
62 | (should= 14790 (solve (slurp "input") 50)))))
63 |
64 |
--------------------------------------------------------------------------------
/day9/spec/day9/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day9.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day9.core :refer :all]))
4 |
5 | (describe "parsing input"
6 | (it "can parse a line"
7 | (should= [1 2 3 4 5] (parse-line "12345")))
8 |
9 | (it "can parse many lines"
10 | (should= [[1 2 3 4] [5 6 7 8]]
11 | (parse-input "1234\n5678\n")))
12 | )
13 |
14 | (def sample-data "2199943210\n3987894921\n9856789892\n8767896789\n9899965678")
15 |
16 | (describe "utilitiies"
17 | (let [data (parse-input "1234\n5678")]
18 | (it "can use coordinates to access the data"
19 | (should= 1 (get-height data [0 0]))
20 | (should= 7 (get-height data [2 1]))
21 | (should= 8 (get-height data [3 1])))
22 |
23 | (it "makes out-of-bounds coordinates max height"
24 | (should= 10 (get-height data [-1 -1]))
25 | (should= 10 (get-height data [0 -1]))
26 | (should= 10 (get-height data [-1 0]))
27 | (should= 10 (get-height data [99 0]))
28 | (should= 10 (get-height data [0 99]))))
29 |
30 | (let [data [[3 3 3]
31 | [3 1 3]
32 | [3 3 3]]]
33 | (it "will decide low point"
34 | (should (low? data [1 1]))
35 | (should-not (low? data [0 0]))
36 | (should-not (low? data [2 2])))
37 |
38 | (it "will find low points"
39 | (should= #{[1 1]} (find-lows data))))
40 |
41 | (context "basins"
42 | (let [data [[9 9 9 9]
43 | [9 9 2 9]
44 | [1 2 0 2]
45 | [9 2 2 9]]]
46 | (it "will find basin points"
47 | (should= #{[2 2]
48 | [1 2]
49 | [2 1]
50 | [3 2]
51 | [2 3]
52 | [0 2]
53 | [1 3]}
54 | (find-basin-points data [2 2])))))
55 | )
56 |
57 | (describe "solutions"
58 | (context "part 1"
59 | (it "solves sample"
60 | (should= 15 (solve-1 sample-data)))
61 | (it "solves problem"
62 | (should= 575 (solve-1 (slurp "input"))))
63 | )
64 |
65 | (context "part 2"
66 | (it "solves sample"
67 | (should= 1134 (solve-2 sample-data)))
68 |
69 | (it "solves problem"
70 | (should= 1019700 (solve-2 (slurp "input"))))))
71 |
--------------------------------------------------------------------------------
/day5/src/day5/core.clj:
--------------------------------------------------------------------------------
1 | (ns day5.core)
2 |
3 | (defn parse-line [s]
4 | (let [coords (re-seq #"\d+" s)
5 | coords (map #(Integer/parseInt %) coords)]
6 | (partition 2 coords)))
7 |
8 | (defn parse-lines [s]
9 | (let [lines (clojure.string/split-lines s)]
10 | (map parse-line lines)))
11 |
12 | (defn- unit [n]
13 | (cond (zero? n) 0
14 | (pos? n) 1
15 | :else -1))
16 |
17 | (defn unit-vector [[[x1 y1] [x2 y2]]]
18 | [(unit (- x2 x1)) (unit (- y2 y1))]
19 | )
20 |
21 | (defn add-vector [[vx vy] [x y]]
22 | [(+ x vx) (+ y vy)])
23 |
24 | (defn points-on-line [line-segment]
25 | (let [[p1 p2] line-segment
26 | uv (unit-vector line-segment)]
27 | (loop [p1 p1 p2 p2 points #{}]
28 | (let [points (conj points p1)]
29 | (if (= p1 p2)
30 | points
31 | (recur (add-vector uv p1) p2 points))))))
32 |
33 | (defn- accumulate-point [accumulator point]
34 | (let [point (vec point)
35 | c (get accumulator point 0)]
36 | (assoc accumulator point (inc c))))
37 |
38 | (defn- accumulate-point-set [accumulator
39 | point-set]
40 | (if (empty? point-set)
41 | accumulator
42 | (recur (accumulate-point
43 | accumulator
44 | (first point-set))
45 | (rest point-set))))
46 |
47 | (defn accumulate-points [point-sets]
48 | (loop [point-sets point-sets
49 | accumulator {}]
50 | (if (empty? point-sets)
51 | accumulator
52 | (recur (rest point-sets)
53 | (accumulate-point-set
54 | accumulator
55 | (first point-sets))))))
56 |
57 | (defn- orthogonal? [[[x1 y1] [x2 y2]]]
58 | (or (= x1 x2) (= y1 y2))
59 | )
60 |
61 | (defn solve-1 [input]
62 | (let [segments (parse-lines input)
63 | segments (filter orthogonal? segments)
64 | points (map points-on-line segments)
65 | accumulator (accumulate-points points)
66 | counts (vals accumulator)]
67 | (count (filter #(> % 1) counts))))
68 |
69 | (defn solve-2 [input]
70 | (let [segments (parse-lines input)
71 | points (map points-on-line segments)
72 | accumulator (accumulate-points points)
73 | counts (vals accumulator)]
74 | (count (filter #(> % 1) counts))))
75 |
--------------------------------------------------------------------------------
/day17/spec/day17/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day17.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day17.core :refer :all]))
4 |
5 | (let [sample "target area: x=20..30, y=-10..-5"
6 | box [20 30 -10 -5]]
7 | (describe "parsing input"
8 | (it "parses"
9 | (should= box
10 | (parse-input sample))))
11 |
12 | (describe "utilities"
13 | (context "in?"
14 | (it "outside"
15 | (should-not (in? box [0 0]))
16 | (should-not (in? box [19 -6]))
17 | (should-not (in? box [31 -6]))
18 | (should-not (in? box [15 -11]))
19 | (should-not (in? box [15 -4])))
20 |
21 | (it "inside"
22 | (should (in? box [20 -10]))
23 | (should (in? box [30 -10]))
24 | (should (in? box [20 -5]))
25 | (should (in? box [25 -7])))
26 | )
27 |
28 | (context "beyond?"
29 | (it "isn't"
30 | (should-not (beyond? box [0 0]))
31 | (should-not (beyond? box [25 -7])))
32 |
33 | (it "is"
34 | (should (beyond? box [31 -7]))
35 | (should (beyond? box [25 -11]))))
36 |
37 | (context "limits"
38 | (it "max-vx"
39 | (should= 31 (max-vx box)))
40 |
41 | (it "min-vx"
42 | (should= 5 (min-vx box)))
43 |
44 | (it "min-vy"
45 | (should= 0 (min-vy box)))
46 |
47 | (it "max-vy"
48 | (should= 11 (max-vy box)))
49 | )
50 |
51 | (context "shot"
52 | (it "misses"
53 | (should= :miss (shot box [0 1]))
54 | (should= :miss (shot box [21 5]))
55 | (should= :miss (shot box [4 5]))
56 | (should= :miss (shot box [6 12]))
57 | (should= :miss (shot box [17 -4]))
58 | )
59 |
60 | (it "hits"
61 | (should= 3 (shot box [7 2]))
62 | (should= 6 (shot box [6 3]))
63 | (should= 0 (shot box [9 0]))
64 | )
65 | )
66 | )
67 |
68 | (describe "solution"
69 | (context "part 1"
70 | (it "solves sample"
71 | (should= 45 (solve-1 (slurp "sample"))))
72 |
73 | (it "solves problem"
74 | (should= 6555 (solve-1 (slurp "input")))))
75 |
76 | (context "part 2"
77 | (it "solves sample"
78 | (should= 112 (solve-2 (slurp "sample"))))
79 |
80 | (it "solves problem"
81 | (should= 4973 (solve-2 (slurp "input"))))))
82 | )
83 |
--------------------------------------------------------------------------------
/day16/spec/day16/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day16.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day16.core :refer :all]))
4 |
5 | (describe "hex to bits"
6 | (it "translates single digits"
7 | (should= "1010" (hex->bits "A"))
8 | (should= "0000" (hex->bits "0"))
9 | (should= "1111" (hex->bits "F"))
10 | (should= "" (hex->bits "G")))
11 |
12 | (it "translates strings"
13 | (should= "10101111" (hex->bits "AF"))
14 | (should= "11011110101011011011111011101111"
15 | (hex->bits "DEADBEEF")))
16 | )
17 |
18 | (describe "packet parsing"
19 | (it "decodes literals"
20 | (should= {:version 6 :type 4 :value 2021 :length 21}
21 | (parse-packet "D2FE28")))
22 |
23 | (context "operators"
24 | (it "decodes bit-length operator"
25 | (should=
26 | {:version 1
27 | :type 6
28 | :length 49
29 | :sub-length 27
30 | :sub-packets [{:version 6 :type 4 :value 10 :length 11}
31 | {:version 2 :type 4 :value 20 :length 16}]}
32 | (parse-packet "38006F45291200")))
33 |
34 | (it "decodes n-packet operator"
35 | (should=
36 | {:version 7
37 | :type 3
38 | :length 51
39 | :n-packets 3
40 | :sub-packets [{:version 2 :type 4 :value 1 :length 11}
41 | {:version 4 :type 4 :value 2 :length 11}
42 | {:version 1 :type 4 :value 3 :length 11}]}
43 | (parse-packet "EE00D40C823060")))
44 |
45 | (it "does sums"
46 | (should= 3 (evaluate (parse-packet "C200B40A82"))))
47 |
48 | (it "does products"
49 | (should= 54 (evaluate (parse-packet "04005AC33890"))))
50 |
51 | (it "does mins"
52 | (should= 7 (evaluate (parse-packet "880086C3E88112"))))
53 |
54 | (it "does maxes"
55 | (should= 9 (evaluate (parse-packet "CE00C43D881120"))))
56 |
57 | (it "does < and >"
58 | (should= 1 (evaluate (parse-packet "D8005AC2A8F0")))
59 | (should= 0 (evaluate (parse-packet "F600BC2D8F"))))
60 |
61 | (it "does ="
62 | (should= 0 (evaluate (parse-packet "9C005AC2F8F0"))))
63 |
64 | (it "does combos"
65 | (should= 1 (evaluate (parse-packet "9C0141080250320F1802104A08"))))
66 | )
67 | )
68 |
69 | (describe "solution"
70 | (context "part 1"
71 | (it "solves problem"
72 | (should= 1007 (solve-1 (slurp "input")))))
73 |
74 | (context "part 2"
75 | (it "solves problem"
76 | (should= 834151779165 (solve-2 (slurp "input")))))
77 | )
78 |
--------------------------------------------------------------------------------
/day19/sample:
--------------------------------------------------------------------------------
1 | --- scanner 0 ---
2 | 404,-588,-901
3 | 528,-643,409
4 | -838,591,734
5 | 390,-675,-793
6 | -537,-823,-458
7 | -485,-357,347
8 | -345,-311,381
9 | -661,-816,-575
10 | -876,649,763
11 | -618,-824,-621
12 | 553,345,-567
13 | 474,580,667
14 | -447,-329,318
15 | -584,868,-557
16 | 544,-627,-890
17 | 564,392,-477
18 | 455,729,728
19 | -892,524,684
20 | -689,845,-530
21 | 423,-701,434
22 | 7,-33,-71
23 | 630,319,-379
24 | 443,580,662
25 | -789,900,-551
26 | 459,-707,401
27 |
28 | --- scanner 1 ---
29 | 686,422,578
30 | 605,423,415
31 | 515,917,-361
32 | -336,658,858
33 | 95,138,22
34 | -476,619,847
35 | -340,-569,-846
36 | 567,-361,727
37 | -460,603,-452
38 | 669,-402,600
39 | 729,430,532
40 | -500,-761,534
41 | -322,571,750
42 | -466,-666,-811
43 | -429,-592,574
44 | -355,545,-477
45 | 703,-491,-529
46 | -328,-685,520
47 | 413,935,-424
48 | -391,539,-444
49 | 586,-435,557
50 | -364,-763,-893
51 | 807,-499,-711
52 | 755,-354,-619
53 | 553,889,-390
54 |
55 | --- scanner 2 ---
56 | 649,640,665
57 | 682,-795,504
58 | -784,533,-524
59 | -644,584,-595
60 | -588,-843,648
61 | -30,6,44
62 | -674,560,763
63 | 500,723,-460
64 | 609,671,-379
65 | -555,-800,653
66 | -675,-892,-343
67 | 697,-426,-610
68 | 578,704,681
69 | 493,664,-388
70 | -671,-858,530
71 | -667,343,800
72 | 571,-461,-707
73 | -138,-166,112
74 | -889,563,-600
75 | 646,-828,498
76 | 640,759,510
77 | -630,509,768
78 | -681,-892,-333
79 | 673,-379,-804
80 | -742,-814,-386
81 | 577,-820,562
82 |
83 | --- scanner 3 ---
84 | -589,542,597
85 | 605,-692,669
86 | -500,565,-823
87 | -660,373,557
88 | -458,-679,-417
89 | -488,449,543
90 | -626,468,-788
91 | 338,-750,-386
92 | 528,-832,-391
93 | 562,-778,733
94 | -938,-730,414
95 | 543,643,-506
96 | -524,371,-870
97 | 407,773,750
98 | -104,29,83
99 | 378,-903,-323
100 | -778,-728,485
101 | 426,699,580
102 | -438,-605,-362
103 | -469,-447,-387
104 | 509,732,623
105 | 647,635,-688
106 | -868,-804,481
107 | 614,-800,639
108 | 595,780,-596
109 |
110 | --- scanner 4 ---
111 | 727,592,562
112 | -293,-554,779
113 | 441,611,-461
114 | -714,465,-776
115 | -743,427,-804
116 | -660,-479,-426
117 | 832,-632,460
118 | 927,-485,-438
119 | 408,393,-506
120 | 466,436,-512
121 | 110,16,151
122 | -258,-428,682
123 | -393,719,612
124 | -211,-452,876
125 | 808,-476,-593
126 | -575,615,604
127 | -485,667,467
128 | -680,325,-822
129 | -627,-443,-432
130 | 872,-547,-609
131 | 833,512,582
132 | 807,604,487
133 | 839,-516,451
134 | 891,-625,532
135 | -652,-548,-490
136 | 30,-46,-14
137 |
--------------------------------------------------------------------------------
/day13/src/day13/core.clj:
--------------------------------------------------------------------------------
1 | (ns day13.core
2 | (:require [clojure.string :as string]
3 | [clojure.set :as set]))
4 |
5 | (defn parse-line [line]
6 | (cond
7 | (re-matches #"\d+,\d+" line)
8 | (let [coords (re-seq #"\d+" line)
9 | coords (map #(Integer/parseInt %) coords)]
10 | [coords []])
11 |
12 | (re-matches #"fold along y=\d+", line)
13 | (let [y (first (re-seq #"\d+" line))
14 | y (Integer/parseInt y)]
15 | [[] [0 y]])
16 |
17 | (re-matches #"fold along x=\d+", line)
18 | (let [x (first (re-seq #"\d+" line))
19 | x (Integer/parseInt x)]
20 | [[] [x 0]])
21 |
22 | :else
23 | [[] []]))
24 |
25 | (defn parse-input [input]
26 | (loop [lines (string/split-lines input)
27 | result {:coords #{} :folds []}]
28 | (if (empty? lines)
29 | result
30 | (let [[coord fold] (parse-line (first lines))
31 | result (if (not-empty coord)
32 | (update result :coords conj coord)
33 | result)
34 | result (if (not-empty fold)
35 | (update result :folds conj fold)
36 | result)]
37 | (recur (rest lines) result)))))
38 |
39 | (defn fold [coords [x y]]
40 | (cond
41 | (zero? x)
42 | (let [sides (group-by #(> (second %) y) coords)
43 | folded (set (map
44 | (fn [[cx cy]]
45 | [cx (- y (- cy y))]) (sides true)))]
46 | (set/union folded (set (sides false))))
47 |
48 | (zero? y)
49 | (let [sides (group-by #(> (first %) x) coords)
50 | folded (set (map
51 | (fn [[cx cy]]
52 | [(- x (- cx x)) cy]) (sides true)))]
53 | (set/union folded (set (sides false))))
54 |
55 | :else
56 | :error))
57 |
58 | (defn solve-1 [input]
59 | (let [{:keys [coords folds]} (parse-input input)
60 | coords (fold coords (first folds))]
61 | (count coords)))
62 |
63 | (defn solve-2 [input]
64 | (let [{:keys [coords folds]} (parse-input input)]
65 | (loop [coords coords
66 | folds folds]
67 | (if (empty? folds)
68 | coords
69 | (recur (fold coords (first folds)) (rest folds))))
70 | ))
71 |
72 | (defn draw [coords]
73 | (let [max-x (apply max (map first coords))
74 | max-y (apply max (map second coords))]
75 | (doseq [y (range (inc max-y))]
76 | (doseq [x (range (inc max-x))]
77 | (print (if (contains? coords [x y]) "*" " ")))
78 | (println))))
--------------------------------------------------------------------------------
/day9/src/day9/core.clj:
--------------------------------------------------------------------------------
1 | (ns day9.core
2 | (:require [clojure.set :as set]))
3 |
4 | (defn- char-to-int [c]
5 | (let [i (int c)
6 | i (- i (int \0))]
7 | i))
8 |
9 | (defn parse-line [line]
10 | (map char-to-int line))
11 |
12 | (defn parse-input [input]
13 | (map parse-line (clojure.string/split-lines input)))
14 |
15 | (defn get-height [data [x y]]
16 | (let [row (nth data y 10)]
17 | (if (= 10 row)
18 | 10
19 | (nth row x 10))))
20 |
21 | (defn low? [data p]
22 | (let [[x y] p
23 | pn [x (dec y)]
24 | pe [(inc x) y]
25 | ps [x (inc y)]
26 | pw [(dec x) y]
27 | hn (get-height data pn)
28 | he (get-height data pe)
29 | hs (get-height data ps)
30 | hw (get-height data pw)
31 | h (get-height data p)]
32 | (and (< h hn)
33 | (< h hs)
34 | (< h he)
35 | (< h hw))))
36 |
37 | (defn find-lows [data]
38 | (let [coords (for [y (range (count data))
39 | x (range (count (first data)))]
40 | [x y])]
41 | (set (filter (partial low? data) coords))))
42 |
43 | (defn find-basin-points
44 | ([data basin-point]
45 | (find-basin-points data basin-point #{}))
46 |
47 | ([data basin-point basin-points]
48 | (let [[x y] basin-point
49 | height (get-height data basin-point)]
50 | (if (or (>= height 9)
51 | (contains? basin-points basin-point))
52 | basin-points
53 | (let [basin-points (conj basin-points basin-point)
54 | basin-points (set/union (find-basin-points data [(inc x) y] basin-points))
55 | basin-points (set/union (find-basin-points data [(dec x) y] basin-points))
56 | basin-points (set/union (find-basin-points data [x (inc y)] basin-points))
57 | basin-points (set/union (find-basin-points data [x (dec y)] basin-points))]
58 | basin-points))))
59 | )
60 |
61 | (defn solve-1 [input]
62 | (let [input (parse-input input)
63 | lows (find-lows input)
64 | heights (map (partial get-height input) lows)
65 | heights (map inc heights)]
66 | (reduce + heights)))
67 |
68 | (defn solve-2 [input]
69 | (let [data (parse-input input)
70 | lows (find-lows data)]
71 | (loop [lows lows basins []]
72 | (if (empty? lows)
73 | (reduce * (take-last 3 (sort (map count basins))))
74 | (let [basin-points (find-basin-points data (first lows))
75 | lows (set/difference lows basin-points)
76 | ]
77 | (recur lows (conj basins basin-points)))))))
78 |
79 |
--------------------------------------------------------------------------------
/day15/samplex5:
--------------------------------------------------------------------------------
1 | 11637517422274862853338597396444961841755517295286
2 | 13813736722492484783351359589446246169155735727126
3 | 21365113283247622439435873354154698446526571955763
4 | 36949315694715142671582625378269373648937148475914
5 | 74634171118574528222968563933317967414442817852555
6 | 13191281372421239248353234135946434524615754563572
7 | 13599124212461123532357223464346833457545794456865
8 | 31254216394236532741534764385264587549637569865174
9 | 12931385212314249632342535174345364628545647573965
10 | 23119445813422155692453326671356443778246755488935
11 | 22748628533385973964449618417555172952866628316397
12 | 24924847833513595894462461691557357271266846838237
13 | 32476224394358733541546984465265719557637682166874
14 | 47151426715826253782693736489371484759148259586125
15 | 85745282229685639333179674144428178525553928963666
16 | 24212392483532341359464345246157545635726865674683
17 | 24611235323572234643468334575457944568656815567976
18 | 42365327415347643852645875496375698651748671976285
19 | 23142496323425351743453646285456475739656758684176
20 | 34221556924533266713564437782467554889357866599146
21 | 33859739644496184175551729528666283163977739427418
22 | 35135958944624616915573572712668468382377957949348
23 | 43587335415469844652657195576376821668748793277985
24 | 58262537826937364893714847591482595861259361697236
25 | 96856393331796741444281785255539289636664139174777
26 | 35323413594643452461575456357268656746837976785794
27 | 35722346434683345754579445686568155679767926678187
28 | 53476438526458754963756986517486719762859782187396
29 | 34253517434536462854564757396567586841767869795287
30 | 45332667135644377824675548893578665991468977611257
31 | 44961841755517295286662831639777394274188841538529
32 | 46246169155735727126684683823779579493488168151459
33 | 54698446526571955763768216687487932779859814388196
34 | 69373648937148475914825958612593616972361472718347
35 | 17967414442817852555392896366641391747775241285888
36 | 46434524615754563572686567468379767857948187896815
37 | 46833457545794456865681556797679266781878137789298
38 | 64587549637569865174867197628597821873961893298417
39 | 45364628545647573965675868417678697952878971816398
40 | 56443778246755488935786659914689776112579188722368
41 | 55172952866628316397773942741888415385299952649631
42 | 57357271266846838237795794934881681514599279262561
43 | 65719557637682166874879327798598143881961925499217
44 | 71484759148259586125936169723614727183472583829458
45 | 28178525553928963666413917477752412858886352396999
46 | 57545635726865674683797678579481878968159298917926
47 | 57944568656815567976792667818781377892989248891319
48 | 75698651748671976285978218739618932984172914319528
49 | 56475739656758684176786979528789718163989182927419
50 | 67554889357866599146897761125791887223681299833479
51 |
--------------------------------------------------------------------------------
/day4/src/day4/core.clj:
--------------------------------------------------------------------------------
1 | (ns day4.core
2 | (:require [clojure.string :as s]))
3 |
4 | (defn parse-input [input]
5 | (let [lines (s/split-lines input)
6 | lines (remove #(= "" %) lines)
7 | draws (map #(Integer/parseInt %) (s/split (first lines) #","))
8 | boards (map
9 | (fn [line] (map
10 | #(Integer/parseInt %)
11 | (remove empty? (s/split line #"\s+"))))
12 | (rest lines))
13 | boards (doall (partition 5 boards))]
14 | [draws boards]))
15 |
16 | (defn play-board [draw board]
17 | (map (fn [row] (map #(if (= draw %) "X" %) row)) board))
18 |
19 | (defn play [draw boards]
20 | (map #(play-board draw %) boards))
21 |
22 |
23 |
24 | (defn row-win? [row] (= row ["X" "X" "X" "X" "X"]))
25 |
26 | (defn win? [board]
27 | (or (some row-win? board)
28 | (some row-win? (apply map list board))))
29 |
30 |
31 | (defn score [draw board]
32 | (if (win? board)
33 | (* draw (reduce + (remove #(= "X" %) (flatten board))))
34 | -1))
35 |
36 | (defn bingo-winner [draws boards]
37 | (loop [draws draws boards boards n 0]
38 | (if (empty? draws)
39 | nil
40 | (let [n (inc n)
41 | draw (first draws)
42 | boards (play draw boards)
43 | scores (map #(score draw %) boards)
44 | top-score (apply max scores)
45 | ]
46 | (if (neg? top-score)
47 | (recur (rest draws) boards n)
48 | top-score)
49 | ))))
50 |
51 | (defn bingo-loser [draws boards]
52 | (loop [draws draws boards boards n 0 last-scores nil last-n nil]
53 | (if (empty? draws)
54 | [last-scores n]
55 | (let [n (inc n)
56 | draw (first draws)
57 | boards (play draw boards)
58 | winners (filter win? boards)
59 | scores (map #(score draw %) winners)
60 | boards (remove win? boards)
61 | ]
62 | (if (empty? scores)
63 | (recur (rest draws) boards n last-scores last-n)
64 | (recur (rest draws) boards n scores n))
65 | ))))
66 |
67 | (defn bingo [draws boards]
68 | (loop [draws draws boards boards n 0 wins [] board-map {}]
69 | (if (empty? draws)
70 | board-map
71 | (let [n (inc n)
72 | draw (first draws)
73 | boards (play draw boards)
74 | winners (filter win? boards)
75 | _ (prn "---" n)
76 | _ (prn winners)
77 | _ (prn (map #(score draw %) winners))
78 | scores (map #(score draw %) boards)
79 | boards (remove win? boards)
80 | ]
81 | (recur (rest draws) boards n (conj wins [scores draw n])
82 | (assoc board-map n boards))
83 | ))))
--------------------------------------------------------------------------------
/day20/src/day20/core.clj:
--------------------------------------------------------------------------------
1 | (ns day20.core
2 | (:require [clojure.string :as string]))
3 |
4 | (defn parse-line [y line]
5 | (loop [line line
6 | image {}
7 | x 0]
8 | (if (empty? line)
9 | image
10 | (recur (rest line)
11 | (assoc image [x y] (first line))
12 | (inc x)))))
13 |
14 | (defn parse-image [lines]
15 | (loop [lines lines
16 | image {}
17 | y 0]
18 | (if (empty? lines)
19 | image
20 | (recur (rest lines)
21 | (merge image (parse-line y (first lines)))
22 | (inc y)))))
23 |
24 | (defn bounds [image]
25 | (let [coords (keys image)
26 | xs (map first coords)
27 | ys (map second coords)
28 | max-x (apply max xs)
29 | min-x (apply min xs)
30 | max-y (apply max ys)
31 | min-y (apply min ys)]
32 | [[min-x min-y] [max-x max-y]]))
33 |
34 | (defn neighbors-of [[x y]]
35 | [[(dec x) (dec y)] [x (dec y)] [(inc x) (dec y)]
36 | [(dec x) y] [x y] [(inc x) y]
37 | [(dec x) (inc y)] [x (inc y)] [(inc x) (inc y)]])
38 |
39 | (defn binary-index-of
40 | ([image coord]
41 | (binary-index-of image coord \.))
42 |
43 | ([image coord default]
44 | (let [bits (neighbors-of coord)
45 | bits (map #(if (= \# (get image % default)) "1" "0") bits)
46 | bits (apply str bits)]
47 | (Integer/parseInt bits 2))))
48 |
49 | (defn expand-box [[[x1 y1] [x2 y2]]]
50 | [[(- x1 1) (- y1 1)] [(+ x2 1) (+ y2 1)]])
51 |
52 | (defn get-pixel [image enhancer point]
53 | (let [index (binary-index-of image point)
54 | pixel (nth enhancer index)]
55 | pixel))
56 |
57 |
58 | (defn enhance [enhancer image]
59 | (let [box (bounds image)
60 | [[x1 y1] [x2 y2]] box
61 | new-image (for [x (range x1 (inc x2))
62 | y (range y1 (inc y2))]
63 | [[x y] (get-pixel image enhancer [x y])])
64 | new-image (reduce #(assoc %1 (first %2) (second %2)) {} new-image)]
65 | new-image))
66 |
67 | (defn draw-image [image]
68 | (let [[[x1 y1] [x2 y2]] (bounds image)]
69 | (doseq [y (range y1 (inc y2))]
70 | (doseq [x (range x1 (inc x2))]
71 | (print (image [x y])))
72 | (println))))
73 |
74 | (defn solve [input n]
75 | (let [lines (string/split-lines input)
76 | lines (remove empty? lines)
77 | enhancer (first lines)
78 | image (parse-image (rest lines))
79 | boxes (iterate expand-box (bounds image))
80 | nth-box (nth boxes n)
81 | inf-box (nth boxes (* 2 n))
82 | image (assoc image (first inf-box) \. (last inf-box) \.)
83 | images (iterate #(enhance enhancer %) image)
84 | final (nth images n)
85 | [[min-x min-y] [max-x max-y]] nth-box
86 | pixels (for [x (range min-x (inc max-x))
87 | y (range min-y (inc max-y))]
88 | (final [x y]))]
89 | (count (filter #(= \# %) pixels))))
90 |
--------------------------------------------------------------------------------
/day11/spec/day11/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day11.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day11.core :refer :all]))
4 |
5 | (describe "parsing the input"
6 | (it "parses a line"
7 | (should= [1 2 3 4 5] (parse-line "12345")))
8 |
9 | (it "parses many lines"
10 | (should= [[1 2 3 4] [5 6 7 8]]
11 | (parse-lines "1234\n5678\n")))
12 |
13 | (it "creates the coordinate map"
14 | (should= {[0 0] 1
15 | [1 0] 2
16 | [2 0] 3
17 | [0 1] 4
18 | [1 1] 5
19 | [2 1] 6} (parse-input "123\n456\n"))))
20 |
21 | (def world3x3 (grid-to-map [[1 1 1]
22 | [1 1 1]
23 | [1 1 1]]))
24 |
25 | (describe "utilities"
26 | (context "diagonals"
27 | (it "calculates diagonals in the middle"
28 | (should= #{[0 0] [1 0] [2 0]
29 | [0 1] [2 1]
30 | [0 2] [1 2] [2 2]} (get-diagonals world3x3 [1 1])))
31 |
32 | (it "will get diagonals of the corners and edges"
33 | (should= #{[1 1] [2 1] [1 2]} (get-diagonals world3x3 [2 2]))
34 | (should= #{[1 0] [0 1] [1 1]} (get-diagonals world3x3 [0 0]))
35 | (should= #{[0 0] [1 0] [1 1] [0 2] [1 2]} (get-diagonals world3x3 [0 1]))))
36 |
37 | (context "flashing"
38 | (it "increments energy"
39 | (should= {[0 0] 1 [1 0] 2}
40 | (increment-energy {[0 0] 0 [1 0] 1})))
41 |
42 | (it "one flasher"
43 | (should= [1 (grid-to-map [[2 2 2]
44 | [2 0 2]
45 | [2 2 2]])]
46 | (flash (grid-to-map [[1 1 1]
47 | [1 10 1]
48 | [1 1 1]]))))
49 |
50 | (it "two flashers"
51 | (should= [2 (grid-to-map [[2 3 3]
52 | [2 0 0]
53 | [2 3 3]])]
54 | (flash (grid-to-map [[1 1 1]
55 | [1 10 10]
56 | [1 1 1]]))))
57 |
58 | (it "cascades flashes"
59 | (should= [3 (grid-to-map [[2 3 3]
60 | [2 0 0]
61 | [2 4 0]])]
62 | (flash (grid-to-map [[1 1 1]
63 | [1 10 10]
64 | [1 1 8]])))))
65 | )
66 |
67 | (def test-data "5483143223\n2745854711\n5264556173\n6141336146\n6357385478\n4167524645\n2176841721\n6882881134\n4846848554\n5283751526")
68 |
69 | (describe "solutions"
70 | (context "part 1"
71 | (it "solves sample"
72 | (should= 1656 (solve-1 (parse-input test-data))))
73 |
74 | (it "solves problem"
75 | (should= 1723 (solve-1 (parse-input (slurp "input")))))
76 |
77 | )
78 |
79 | (context "part 2"
80 | (it "solves sample"
81 | (should= 195 (solve-2 (parse-input test-data))))
82 |
83 | (it "solves problem"
84 | (should= 327 (solve-2 (parse-input (slurp "input"))))))
85 | )
86 |
87 |
--------------------------------------------------------------------------------
/day14/spec/day14/core_spec.clj:
--------------------------------------------------------------------------------
1 | (ns day14.core-spec
2 | (:require [speclj.core :refer :all]
3 | [day14.core :refer :all]))
4 |
5 | (describe "parsing"
6 | (it "parses a line"
7 | (should= [:template "NNCB"]
8 | (parse-line "NNCB"))
9 | (should= [:template "ABCDE"]
10 | (parse-line "ABCDE"))
11 | (should= [:insert ["NN" "C"]]
12 | (parse-line "NN -> C")))
13 |
14 | (it "parses many lines"
15 | (should= {:template "NNBC"
16 | :insert {"NN" "C"
17 | "BB" "D"}}
18 | (parse-input "NNBC\n\nNN -> C\nBB -> D\n")))
19 |
20 | )
21 |
22 | (describe "utilities"
23 | (it "polymerizes"
24 | (should= "ACB"
25 | (polymerize {"AB" "C"}
26 | "AB"))
27 | (should= "ADBEC"
28 | (polymerize {"AB" "D"
29 | "BC" "E"}
30 | "ABC")))
31 |
32 | (it "counts dimers"
33 | (should= {}
34 | (count-dimers ""))
35 | (should= {}
36 | (count-dimers "A"))
37 | (should= {"AB" 1}
38 | (count-dimers "AB"))
39 | (should= {"AB" 1
40 | "BC" 1}
41 | (count-dimers "ABC"))
42 | (should= {"AB" 2
43 | "BC" 2
44 | "CA" 1}
45 | (count-dimers "ABCABC")))
46 |
47 | (it "count insertions"
48 | (should= {}
49 | (count-insertions {} {}))
50 |
51 | (should= {"AB" 1}
52 | (count-insertions {} {"AB" 1}))
53 |
54 | (should= {}
55 | (count-insertions {"AB" "C"} {}))
56 |
57 | (should= {"AC" 1
58 | "CB" 1}
59 | (count-insertions {"AB" "C"}
60 | {"AB" 1}))
61 |
62 | (should= {"AD" 2
63 | "DB" 1
64 | "DC" 1}
65 | (count-insertions {"AB" "D"
66 | "AC" "D"}
67 | {"AB" 1
68 | "AC" 1}))
69 |
70 | )
71 |
72 | (context "sample data"
73 | (let [{:keys [template insert]} (parse-input (slurp "sample"))
74 | iteration (iterate (partial polymerize insert) template)]
75 | (it "polymerizes"
76 | (should= "NCNBCHB" (nth iteration 1))
77 | (should= "NBCCNBBBCBHCB" (nth iteration 2))
78 | (should= "NBBBCNCCNBBNBNBBCHBHHBCHB" (nth iteration 3))))
79 | )
80 | )
81 |
82 | (describe "solutions"
83 | (context "part 1"
84 | (it "solves sample"
85 | (should= 1588 (solve-1 (slurp "sample"))))
86 |
87 | (it "solves problem"
88 | (should= 3697 (solve-1 (slurp "input"))))
89 | )
90 |
91 | (context "part 2"
92 | (it "solves sample for 10"
93 | (should= 1588 (solve-2 10 (slurp "sample"))))
94 |
95 | (it "solves sample for 40"
96 | (should= 2188189693529 (solve-2 40 (slurp "sample"))))
97 |
98 | (it "solves problem"
99 | (should= 4371307836157 (solve-2 40 (slurp "input"))))
100 | )
101 | )
102 |
--------------------------------------------------------------------------------
/day12/src/day12/core.clj:
--------------------------------------------------------------------------------
1 | (ns day12.core
2 | (:require [clojure.string :as string]
3 | [clojure.set :as set]))
4 |
5 | (defn parse-line [line]
6 | (re-seq #"\w+" line))
7 |
8 | (defn parse-lines [lines]
9 | (map parse-line (string/split-lines lines)))
10 |
11 | (defn add-path [path-map [a b]]
12 | (let [a-paths (get path-map a #{})
13 | b-paths (get path-map b #{})
14 | a-paths (if (= "start" b)
15 | a-paths
16 | (conj a-paths b))
17 | b-paths (if (= "start" a)
18 | b-paths
19 | (conj b-paths a))
20 | path-map (assoc path-map a a-paths)
21 | path-map (assoc path-map b b-paths)]
22 | path-map))
23 |
24 | (defn paths->map [paths]
25 | (loop [paths paths
26 | path-map {}]
27 | (if (empty? paths)
28 | path-map
29 | (recur (rest paths)
30 | (add-path path-map (first paths))))))
31 |
32 | (defn parse-input [input]
33 | (let [paths (parse-lines input)
34 | path-map (paths->map paths)]
35 | path-map))
36 |
37 | (defn small? [cave]
38 | (re-matches #"[a-z]+" cave))
39 |
40 | (defn format-path [path]
41 | (string/join "," path))
42 |
43 | (defn format-paths [paths]
44 | (set (map format-path paths)))
45 |
46 | (defn special-cave-visits [special-cave cur-path]
47 | (count (filter #(= special-cave %) cur-path)))
48 |
49 | (defn find-paths
50 | ([path-map]
51 | (find-paths path-map nil))
52 |
53 | ([path-map special-cave]
54 | (let [end (path-map "end")
55 | start (path-map "start")]
56 | (if (or (nil? start) (nil? end))
57 | []
58 | (find-paths path-map special-cave "start" []))))
59 |
60 | ([path-map special-cave cave cur-path]
61 | (let [new-cur-path (conj cur-path cave)
62 | cur-path-set (set cur-path)
63 | skip-cave? (and (contains? cur-path-set cave)
64 | (small? cave))
65 | special-case? (and
66 | (= cave special-cave)
67 | (< (special-cave-visits special-cave cur-path) 2))
68 | skip-cave? (if (nil? special-cave)
69 | skip-cave?
70 | (and skip-cave? (not special-case?)))]
71 | (cond
72 | (= "end" cave)
73 | [new-cur-path]
74 |
75 | skip-cave?
76 | []
77 |
78 | :else
79 | (loop [neighbors (path-map cave)
80 | paths []]
81 | (if (empty? neighbors)
82 | paths
83 | (let [p (find-paths path-map
84 | special-cave
85 | (first neighbors)
86 | new-cur-path)]
87 | (recur (rest neighbors)
88 | (concat paths p)))))))
89 | )
90 | )
91 |
92 | (defn solve-2 [path-map]
93 | (let [small-caves (keys path-map)
94 | small-caves (remove #(= "start" %) small-caves)
95 | small-caves (remove #(= "end" %) small-caves)
96 | small-caves (filter small? small-caves)
97 | paths (set (mapcat #(find-paths path-map %) small-caves))]
98 | (count paths)))
99 |
--------------------------------------------------------------------------------