├── 2016 ├── day01 │ ├── README.org │ ├── andsanmar.hs │ ├── cesar │ │ ├── code.py │ │ ├── input │ │ └── second_part.py │ ├── ignacio │ │ └── Day1.py │ └── rock │ │ └── directions.py ├── day02 │ ├── andsanmar │ ├── andsanmar.rs │ ├── ignacio │ │ └── day2.py │ ├── input │ └── rock │ │ └── bath.hs ├── day03 │ ├── andsanmar │ ├── andsanmar.rs │ ├── andsanmar.rs~ │ ├── day3.rs~ │ ├── ignacio │ │ └── day3.hs │ ├── input │ └── rock │ │ ├── input.txt │ │ └── triangules.js ├── day04 │ ├── ignacio │ │ ├── day4.py │ │ └── input.txt │ └── rock │ │ ├── input.txt │ │ └── rooms.py ├── day05 │ ├── andsanmar │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ ├── ignacio │ │ └── day5.py │ └── rock │ │ └── main.go ├── day06 │ └── rock │ │ ├── input.txt │ │ └── main.jl ├── day07 │ └── rock │ │ ├── input.txt │ │ ├── input2.txt │ │ └── tls.py └── day08 │ └── rock │ ├── input.txt │ └── screen.py ├── 2017 ├── day01 │ ├── cuwano │ │ ├── day1.ex │ │ ├── day1.hs │ │ └── input │ ├── foldr │ │ ├── part1 │ │ │ └── main.rb │ │ └── part2 │ │ │ └── main.rb │ ├── golot │ │ └── caca.js │ ├── ignacio │ │ └── day1.hs │ ├── luis │ │ ├── day1.hs │ │ └── input.txt │ ├── paloma │ │ └── n1.hs │ ├── rock │ │ └── day1.py │ ├── rubenaguadoc │ │ └── Day1.py │ └── skgsergio │ │ └── captcha.py ├── day02 │ ├── andsanmar.py │ ├── cuwano │ │ ├── day2.hs │ │ ├── day2_part2.ex │ │ └── input │ ├── foldr │ │ ├── _input │ │ ├── input │ │ ├── part1.rb │ │ ├── part2.rb │ │ ├── test1 │ │ └── test2 │ ├── ignacio │ │ └── checksum.hs │ ├── input │ ├── luis │ │ ├── day2.hs │ │ └── input.txt │ ├── paloma │ │ ├── day2.hs │ │ └── list.txt │ ├── rockneurotiko │ │ └── day2.py │ ├── rubenaguadoc │ │ └── Day2.py │ └── skgsergio │ │ ├── checksum.py │ │ ├── input │ │ ├── input_sample │ │ └── input_sample_2 ├── day03 │ ├── foldr │ │ ├── part1 │ │ ├── part1.c │ │ ├── part2 │ │ ├── part2.hi │ │ ├── part2.hs │ │ ├── part2.o │ │ └── part2.rb │ ├── ignacio │ │ └── memory.hs │ ├── paloma │ │ └── spiral.hs │ ├── rubenaguadoc │ │ ├── Day3.py │ │ └── Grid.py │ └── skgsergio │ │ └── spiral.py ├── day04 │ ├── andsanmar.py │ ├── andsanmar_2.py │ ├── foldr │ │ ├── input │ │ ├── part1.rb │ │ └── part2.rb │ ├── ignacio │ │ ├── input.txt │ │ ├── passphrase.hs │ │ └── passphrase.py │ ├── luis │ │ ├── day4.hs │ │ └── input.txt │ ├── paloma │ │ └── passphrase.hs │ ├── rubenaguadoc │ │ ├── Day4.py │ │ └── pass │ └── skgsergio │ │ ├── input │ │ └── passphrases.py ├── day05 │ ├── andsanmar.py │ ├── andsanmar_2.py │ ├── foldr │ │ ├── input │ │ ├── part1.rb │ │ ├── part2.rb │ │ └── test │ ├── ignacio │ │ └── rts.hs │ ├── input │ ├── luis │ │ ├── day5.hs │ │ └── input.txt │ ├── rubenaguadoc │ │ ├── Day5.py │ │ └── jumpStack │ └── skgsergio │ │ ├── input │ │ ├── input_sample │ │ └── maze.py ├── day06 │ ├── andsanmar.py │ ├── foldr │ │ ├── input │ │ ├── part1.rb │ │ ├── part2.rb │ │ └── test │ ├── ignacio │ │ └── reallocate.hs │ ├── rubenaguadoc │ │ └── Day6.py │ └── skgsergio │ │ ├── input │ │ ├── input_sample │ │ └── memory.py ├── day07 │ ├── andsanmar.py │ ├── andsanmar.result │ ├── andsanmar_2.py │ ├── foldr │ │ ├── input │ │ ├── part1.rb │ │ ├── part2.rb │ │ └── test │ ├── input │ ├── input_sample │ ├── rubenaguadoc │ │ ├── Day7.py │ │ ├── procces.py │ │ └── towerData │ └── skgsergio │ │ ├── circus.py │ │ ├── input │ │ ├── input_good │ │ └── input_sample ├── day08 │ ├── andsanmar.py │ ├── foldr │ │ ├── input │ │ ├── part1.rb │ │ └── test │ ├── input │ ├── rubenaguadoc │ │ ├── Day8.py │ │ └── registers │ └── skgsergio │ │ ├── input │ │ ├── input_sample │ │ └── registers.py ├── day09 │ ├── andsanmar.py │ ├── foldr │ │ ├── Makefile │ │ ├── input │ │ ├── part1.hs │ │ ├── part2.hs │ │ └── tests │ ├── input │ ├── rubenaguadoc │ │ ├── Day9.py │ │ └── stream │ └── skgsergio │ │ ├── input │ │ └── stream.py ├── day10 │ ├── foldr │ │ ├── part1.rb │ │ └── part2.rb │ ├── rubenaguadoc │ │ └── Day10.py │ └── skgsergio │ │ ├── input │ │ └── knot.py ├── day11 │ ├── andsanmar.py │ ├── foldr │ │ ├── Makefile │ │ ├── input │ │ ├── part1.hs │ │ └── part2.hs │ ├── input │ ├── rubenaguadoc │ │ ├── Day11.py │ │ └── input │ └── skgsergio │ │ ├── hexed.py │ │ ├── input │ │ └── input_sample ├── day12 │ ├── andsanmar.py │ ├── andsanmar_2.py │ ├── foldr │ │ ├── input │ │ ├── part1.rb │ │ ├── part2.rb │ │ └── test │ ├── input │ ├── input_sample │ ├── rubenaguadoc │ │ ├── Day12.py │ │ └── input │ └── skgsergio │ │ ├── input │ │ ├── input_sample │ │ └── plumber.py ├── day13 │ ├── andsanmar.py │ ├── andsanmar.result │ ├── input │ ├── input_sample │ ├── rubenaguadoc │ │ ├── Day13.py │ │ └── input │ └── skgsergio │ │ ├── input │ │ ├── input_sample │ │ └── packet.py ├── day14 │ ├── andsanmar.py │ ├── andsanmar.result │ ├── rubenaguadoc │ │ ├── Day14.py │ │ └── knotHash.py │ └── skgsergio │ │ └── defrag.py ├── day15 │ ├── andsanmar.py │ ├── andsanmar_2.py │ ├── rubenaguadoc │ │ └── Day15.py │ └── skgsergio │ │ ├── generators.py │ │ └── input ├── day16 │ ├── andsanmar.py │ ├── input │ ├── rubenaguadoc │ │ ├── Day16.py │ │ └── input │ └── skgsergio │ │ ├── input │ │ └── permutation.py ├── day17 │ ├── andsanmar.py │ ├── rubenaguadoc │ │ └── Day17.py │ └── skgsergio │ │ └── spinlock.py ├── day18 │ ├── rubenaguadoc │ │ ├── Day18.py │ │ ├── Day18Part2.py │ │ └── input │ └── skgsergio │ │ ├── duet.py │ │ └── input └── day19 │ └── skgsergio │ ├── input │ └── tubes.py ├── 2018 ├── day01 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── david-jl │ │ ├── 01.js │ │ └── input.txt │ ├── devcexx │ │ ├── build.sbt │ │ ├── project │ │ │ ├── build.properties │ │ │ └── plugins.sbt │ │ └── src │ │ │ └── main │ │ │ └── scala │ │ │ └── Day01.scala │ ├── golot │ │ ├── day1.cpp │ │ ├── input.txt │ │ └── killmepls.js │ ├── ignaciobll │ │ ├── calibration.hs │ │ ├── calibration.py │ │ └── calibration2.py │ ├── ironjanowar │ │ ├── README.md │ │ ├── config │ │ │ └── config.exs │ │ ├── input │ │ ├── lib │ │ │ └── ironjanowar.ex │ │ ├── mix.exs │ │ ├── src │ │ │ ├── parser.erl │ │ │ └── parser.xrl │ │ └── test │ │ │ ├── ironjanowar_test.exs │ │ │ └── test_helper.exs │ ├── jorge │ │ └── Day1.pyx │ ├── regull4r │ │ └── main.rs │ ├── rock │ │ └── solution.el │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── samgh96 │ │ └── day01 │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── input.txt │ │ │ └── src │ │ │ └── main.rs │ ├── sami286 │ │ ├── day1.kt │ │ └── input │ └── skgsergio │ │ ├── calibration.py │ │ └── input ├── day02 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── david-jl │ │ ├── 02.js │ │ └── input.txt │ ├── ignaciobll │ │ └── checksum.hs │ ├── ironjanowar │ │ ├── README.md │ │ ├── config │ │ │ └── config.exs │ │ ├── input │ │ ├── lib │ │ │ └── ironjanowar.ex │ │ ├── mix.exs │ │ ├── src │ │ │ └── parser.xrl │ │ └── test │ │ │ ├── ironjanowar_test.exs │ │ │ └── test_helper.exs │ ├── rock │ │ ├── input │ │ └── solution.pony │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── sami286 │ │ ├── day2.kt │ │ └── input │ └── skgsergio │ │ ├── ims.py │ │ └── input ├── day03 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── david-jl │ │ ├── 03.js │ │ └── input.txt │ ├── ignaciobll │ │ └── fabric.hs │ ├── ironjanowar │ │ ├── README.md │ │ ├── config │ │ │ └── config.exs │ │ ├── input │ │ ├── lib │ │ │ ├── ironjanowar.ex │ │ │ └── solve1 │ │ │ │ └── agent.ex │ │ ├── mix.exs │ │ ├── mix.lock │ │ ├── src │ │ │ └── lex.xrl │ │ └── test │ │ │ ├── ironjanowar_test.exs │ │ │ └── test_helper.exs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solution.rb │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── sami286 │ │ ├── day3.kt │ │ └── input │ └── skgsergio │ │ ├── input │ │ └── slice.py ├── day04 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── david-jl │ │ ├── 04.js │ │ └── input.txt │ ├── ignaciobll │ │ └── sneaky.hs │ ├── ironjanowar │ │ ├── README.md │ │ ├── config │ │ │ └── config.exs │ │ ├── lib │ │ │ └── ironjanowar.ex │ │ ├── mix.exs │ │ ├── mix.lock │ │ └── test │ │ │ ├── ironjanowar_test.exs │ │ │ └── test_helper.exs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solution.py │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── sami286 │ │ ├── day4.kt │ │ └── input │ └── skgsergio │ │ ├── input │ │ └── record.py ├── day05 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── ignaciobll │ │ └── polymer.hs │ ├── ironjanowar │ │ ├── README.md │ │ ├── config │ │ │ └── config.exs │ │ ├── input │ │ ├── lib │ │ │ └── ironjanowar.ex │ │ ├── mix.exs │ │ ├── test │ │ │ ├── ironjanowar_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solution.ex │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── sami286 │ │ ├── day5.kt │ │ └── input │ └── skgsergio │ │ ├── input │ │ └── reduction.py ├── day06 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── ignaciobll │ │ └── voronoi.hs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── sami286 │ │ ├── day6.kt │ │ └── input │ └── skgsergio │ │ ├── chronal.py │ │ └── input ├── day07 │ ├── andsanmar.hs │ ├── andsanmar.input │ ├── rock │ │ ├── input │ │ ├── input_test │ │ ├── solve.ex │ │ └── solve.js │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ ├── sami286 │ │ └── day7.kt │ └── skgsergio │ │ ├── input │ │ └── steps.py ├── day08 │ ├── andsanmar.hs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── tree.ex │ ├── rubenaguadoc │ │ ├── input.txt │ │ └── main.js │ └── skgsergio │ │ ├── input │ │ └── memory.py ├── day09 │ ├── andsanmar.hs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── LinkedList.js │ │ ├── star1.js │ │ └── star2.js │ └── skgsergio │ │ ├── input │ │ └── marble.py ├── day10 │ ├── andsanmar.hs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── index.html │ │ ├── input.js │ │ └── main.js │ └── skgsergio │ │ ├── input │ │ └── stars.py ├── day11 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── benchmark.js │ │ └── main.js │ └── skgsergio │ │ └── charge.py ├── day12 │ ├── andsanmar.hs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── input.txt │ │ ├── main.js │ │ └── testInput.txt │ └── skgsergio │ │ ├── input │ │ ├── sustainability.py │ │ └── sustainability_substr_method.py ├── day13 │ ├── andsanmar.hs │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── input.txt │ │ ├── main.js │ │ └── noFunciona.js │ └── skgsergio │ │ ├── input │ │ └── madness.py ├── day14 │ ├── rock │ │ └── solve.ex │ ├── rubenaguadoc │ │ └── main.js │ └── skgsergio │ │ └── chocolate.py ├── day15 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ ├── input_test2 │ │ └── solve.ex │ └── skgsergio │ │ ├── bandits.py │ │ ├── bandits_pypy_compatible.py │ │ └── input ├── day16 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── rubenaguadoc │ │ ├── input.txt │ │ ├── instructions.js │ │ └── main.js │ └── skgsergio │ │ ├── classification.py │ │ └── input ├── day17 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── skgsergio │ │ ├── input │ │ └── reservoir.py ├── day18 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── skgsergio │ │ ├── input │ │ └── lumber.py ├── day19 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── skgsergio │ │ ├── flow.py │ │ └── input ├── day20 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── skgsergio │ │ ├── input │ │ └── regexmap.py ├── day21 │ ├── rock │ │ ├── input │ │ └── solve.ex │ └── skgsergio │ │ ├── conversion.py │ │ └── input ├── day22 │ ├── rock │ │ └── solve.ex │ └── skgsergio │ │ ├── input │ │ └── maze.py ├── day23 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── skgsergio │ │ ├── input │ │ └── teletransportation.py ├── day24 │ ├── rock │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── skgsergio │ │ ├── input │ │ └── iss20xx.py └── day25 │ ├── rock │ ├── input │ ├── input_test │ └── solve.ex │ └── skgsergio │ ├── 4Dadventure.py │ └── input ├── 2019 ├── day01 │ ├── andsanmar │ │ └── main.hs │ ├── charly98cma │ │ ├── day1_rocketequation.adb │ │ ├── day1_rocketequation.ali │ │ └── input.txt │ ├── foldr │ │ ├── one.ml │ │ └── two.ml │ ├── golot │ │ ├── day1.cpp │ │ └── input.txt │ ├── ironjanowar │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── advent_code.ex │ │ ├── mix.exs │ │ └── test │ │ │ ├── advent_code_test.exs │ │ │ └── test_helper.exs │ ├── jasviers │ │ ├── imput1.txt │ │ └── main.py │ ├── jfagoagas │ │ └── day1.go │ ├── justantors │ │ ├── input_file.txt │ │ └── puzzle1.py │ ├── owayss │ │ ├── fuel.go │ │ ├── fuel_test.go │ │ └── input │ ├── samgh96 │ │ ├── day1.nim │ │ └── input.txt │ └── skgsergio │ │ ├── input │ │ └── mass.py ├── day02 │ ├── andsanmar │ │ └── main.hs │ ├── foldr │ │ ├── one.ml │ │ └── two.ml │ ├── golot │ │ └── day2.cpp │ ├── jfagoagas │ │ └── day2.go │ ├── owayss │ │ ├── input │ │ ├── intcode.go │ │ └── intcode_test.go │ ├── samgh96 │ │ ├── input.txt │ │ └── intcode.nim │ └── skgsergio │ │ ├── alarm.py │ │ ├── alarm_pijo.py │ │ └── input ├── day03 │ ├── andsanmar │ │ └── main.hs │ ├── foldr │ │ ├── one.ml │ │ └── two.ml │ ├── owayss │ │ ├── crossed_wires.go │ │ ├── crossed_wires_test.go │ │ └── input │ └── skgsergio │ │ ├── input │ │ ├── wires.go │ │ └── wires.py ├── day04 │ ├── andsanmar │ │ └── main.hs │ ├── foldr │ │ ├── one.ml │ │ └── two.ml │ ├── ironjanowar │ │ ├── README.md │ │ ├── lib │ │ │ └── advent_code.ex │ │ ├── mix.exs │ │ └── test │ │ │ ├── advent_code_test.exs │ │ │ └── test_helper.exs │ ├── jfagoagas │ │ └── day4.go │ └── skgsergio │ │ ├── container.go │ │ └── container.py ├── day05 │ ├── foldr │ │ └── one_and_two.ml │ ├── jfagoagas │ │ └── day5.go │ └── skgsergio │ │ ├── asteroids.py │ │ ├── asteroids_pijo.py │ │ └── input ├── day06 │ ├── foldr │ │ ├── one.ml │ │ └── two.ml │ ├── jfagoagas │ │ └── day6.go │ └── skgsergio │ │ ├── input │ │ └── orbits.py ├── day07 │ ├── foldr │ │ └── one.ml │ └── skgsergio │ │ ├── amplifiers.py │ │ └── input ├── day08 │ └── skgsergio │ │ ├── image.py │ │ └── input ├── day09 │ └── skgsergio │ │ ├── boost.py │ │ └── input ├── day10 │ └── skgsergio │ │ ├── input │ │ └── monitoring.py ├── day11 │ └── skgsergio │ │ ├── input │ │ └── police.py ├── day12 │ └── skgsergio │ │ ├── input │ │ └── nbody.py ├── day13 │ └── skgsergio │ │ ├── arcade.py │ │ └── input ├── day14 │ └── skgsergio │ │ ├── input │ │ └── react.py ├── day15 │ └── skgsergio │ │ ├── input │ │ └── oxygen.py ├── day16 │ └── skgsergio │ │ ├── fft.py │ │ └── input ├── day17 │ └── skgsergio │ │ ├── input │ │ └── setforget.py ├── day18 │ └── skgsergio │ │ ├── input │ │ └── manyworlds.py ├── day19 │ └── skgsergio │ │ ├── beam.py │ │ └── input ├── day20 │ └── skgsergio │ │ ├── input │ │ └── queputapereza.py ├── day21 │ └── skgsergio │ │ ├── input │ │ └── springdroid.py ├── day22 │ └── skgsergio │ │ ├── input │ │ └── shuffle.py ├── day23 │ └── skgsergio │ │ ├── cat6.py │ │ └── input ├── day24 │ └── skgsergio │ │ ├── discord.py │ │ └── input └── day25 │ └── skgsergio │ ├── exclude │ ├── game.py │ └── input ├── 2020 ├── day01 │ ├── Charly98cma │ │ ├── day01.py │ │ └── input.txt │ ├── FORGIS98 │ │ ├── input.txt │ │ ├── reportRepair.ex │ │ └── reportRepair.py │ ├── aafrecct │ │ ├── day01.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day1.py │ │ └── input.txt │ ├── cuwano │ │ └── day_1.ex │ ├── davidmazarro │ │ ├── Main.hs │ │ └── input.txt │ ├── ignaciobll │ │ ├── day01.hs │ │ ├── day01.txt │ │ └── doy01-example.txt │ ├── jfagoagas │ │ └── day01.go │ ├── kamiyuzu │ │ └── day1.ex │ ├── petacreepers23 │ │ └── AdventCodeDay1.cpp │ ├── pxp9 │ │ └── AD1.py │ ├── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── samgh96 │ │ └── day1.sh ├── day02 │ ├── Charly98cma │ │ ├── day02.cpp │ │ ├── day02.py │ │ └── input.txt │ ├── FORGIS98 │ │ ├── input.txt │ │ ├── passwordPhilosophy.ex │ │ └── passwordPhilosophy.py │ ├── aafrecct │ │ ├── day02.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day02.py │ │ └── input.txt │ ├── cuwano │ │ └── day_2.ex │ ├── davidmazarro │ │ ├── Main.hs │ │ └── input.txt │ ├── ignaciobll │ │ ├── day02.hs │ │ └── input02.txt │ ├── jfagoagas │ │ └── day02.go │ ├── kamiyuzu │ │ └── challenge.ex │ ├── petacreepers23 │ │ └── AdventCodeDay2.cpp │ ├── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ └── samgh96 │ │ └── day02.sh ├── day03 │ ├── Charly98cma │ │ ├── day03.py │ │ └── input.txt │ ├── FORGIS98 │ │ ├── TobogganTrajectory.scala │ │ └── input.txt │ ├── aafrecct │ │ ├── day03.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day03.py │ │ └── input.txt │ ├── cuwano │ │ └── day_3.ex │ ├── davidmazarro │ │ ├── Main.hs │ │ └── input.txt │ ├── ignaciobll │ │ ├── day03.hs │ │ ├── example.txt │ │ └── input.txt │ ├── jfagoagas │ │ └── day03.go │ ├── kamiyuzu │ │ └── challenge.ex │ ├── petacreepers23 │ │ └── AdventCode3.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day04 │ ├── Charly98cma │ │ └── day04.py │ ├── FORGIS98 │ │ ├── input.txt │ │ └── passportProcessing.py │ ├── aafrecct │ │ ├── day04.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day04.py │ │ └── input.txt │ ├── cuwano │ │ └── day_4.ex │ ├── davidmazarro │ │ ├── Main.hs │ │ └── input.txt │ ├── jfagoagas │ │ └── day04.go │ ├── kamiyuzu │ │ └── challenge.ex │ ├── petacreepers23 │ │ └── Adevnt4.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ ├── invalids │ │ ├── solve.ex │ │ └── valids ├── day05 │ ├── Charly98cma │ │ └── day05.py │ ├── FORGIS98 │ │ ├── binaryBoarding.py │ │ └── input.txt │ ├── aafrecct │ │ ├── day05.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day05.py │ │ └── input.txt │ ├── cuwano │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── jfagoagas │ │ ├── day05.go │ │ └── day05_v2.go │ ├── kamizuyu │ │ └── challenge.ex │ ├── petacreepers23 │ │ └── Day5.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day06 │ ├── Charly98cma │ │ └── day06.py │ ├── FORGIS98 │ │ ├── customCustoms.cpp │ │ └── input.txt │ ├── aafrecct │ │ ├── day06.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day06.py │ │ └── input.txt │ ├── cuwano │ │ ├── input │ │ ├── input_test │ │ └── solve.ex │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── jfagoagas │ │ └── day06.go │ ├── kamiyuzu │ │ └── challenge.ex │ ├── petacreepers23 │ │ └── Day6.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input2 │ │ ├── input_test │ │ └── solve.ex ├── day07 │ ├── Charly98cma │ │ └── day07.py │ ├── FORGIS98 │ │ ├── handyHaversacks.py │ │ └── input.txt │ ├── aafrecct │ │ ├── day07.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day07.py │ │ └── input.txt │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── jfagoagas │ │ └── day07.go │ ├── petacreepers23 │ │ └── Day7.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ ├── input_test2 │ │ └── solve.ex ├── day08 │ ├── Charly98cma │ │ └── day08.py │ ├── FORGIS98 │ │ ├── handheldHalting.py │ │ └── input.txt │ ├── aafrecct │ │ ├── day08.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day08.py │ │ └── input.txt │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── ignaciobll │ │ ├── day08.hs │ │ ├── example.txt │ │ └── input.txt │ ├── jfagoagas │ │ └── day08.go │ ├── kamiyuzu │ │ └── challenge.ex │ ├── petacreepers23 │ │ └── day8.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day09 │ ├── Charly98cma │ │ └── day09.py │ ├── FORGIS98 │ │ ├── encodingError.groovy │ │ └── input.txt │ ├── aafrecct │ │ ├── day09.py │ │ └── input │ ├── andsanmar.rs │ ├── csanchez │ │ ├── day09.py │ │ └── input.txt │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── ignaciobll │ │ ├── day09.hs │ │ ├── example.txt │ │ └── input.txt │ ├── jfagoagas │ │ ├── day09.go │ │ └── day09_v2.go │ ├── petacreepers23 │ │ └── Day9.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day10 │ ├── FORGIS98 │ │ ├── adapterArray.groovy │ │ └── input.txt │ ├── aafrecct │ │ ├── day10.py │ │ ├── input │ │ └── input2 │ ├── andsanmar.rs │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── ignaciobll │ │ ├── day10.hs │ │ ├── example.txt │ │ └── input.txt │ ├── jfagoagas │ │ └── day10.go │ ├── petacreepers23 │ │ └── Day10.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ ├── input_test2 │ │ └── solve.ex ├── day11 │ ├── aafreect │ │ ├── day11.py │ │ └── input │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day11.py │ │ └── input │ ├── ignaciobll │ │ ├── day11.hs │ │ ├── example.txt │ │ └── input.txt │ ├── jfagoagas │ │ └── day11.go │ ├── petacreepers23 │ │ └── day11.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day12 │ ├── andsanmar.rs │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── ignaciobll │ │ ├── day12.hs │ │ ├── example.txt │ │ └── input.txt │ ├── petacreepers23 │ │ └── day12.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day13 │ ├── andsanmar.rs │ ├── davidmazarro │ │ ├── Main.hs │ │ └── input.txt │ ├── ignaciobll │ │ ├── day13.hs │ │ ├── day13.mzn │ │ ├── example.txt │ │ └── input.txt │ ├── petacreepers23 │ │ ├── StringUtils.hpp │ │ └── day13.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day14 │ ├── andsanmar.rs │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── ignaciobll │ │ ├── day14.hs │ │ ├── example.txt │ │ └── input.txt │ ├── jfagoagas │ │ └── day14.go │ ├── petacreepers23 │ │ ├── StringUtils.hpp │ │ └── day14.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ ├── input_test2 │ │ └── solve.ex ├── day15 │ ├── andsanmar.rs │ ├── davidmazarro │ │ ├── input.txt │ │ └── main.rs │ ├── jfagoagas │ │ └── day15.go │ ├── petacreepers23 │ │ └── day15.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day16 │ ├── andsanmar.rs │ ├── petacreepers23 │ │ ├── StringUtils.hpp │ │ └── day16.cpp │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day17 │ ├── andsanmar_1.rs │ ├── andsanmar_2.rs │ ├── ignaciobll │ │ ├── day17.hs │ │ ├── example.txt │ │ └── input.txt │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day18 │ ├── andsanmar.rs │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day19 │ ├── andsanmar.rs │ ├── ignaciobll │ │ ├── day19.hs │ │ ├── example.txt │ │ └── input.txt │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ ├── input_test2 │ │ ├── input_test3 │ │ ├── python │ │ ├── solve.ex │ │ └── test.py ├── day20 │ ├── andsanmar.rs │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day21 │ ├── andsanmar.rs │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day22 │ ├── andsanmar.rs │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ ├── input_test2 │ │ └── solve.ex ├── day23 │ ├── andsanmar.rs │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex ├── day24 │ ├── andsanmar.rs │ └── rockneurotiko │ │ ├── input │ │ ├── input_test │ │ └── solve.ex └── day25 │ ├── andsanmar.rs │ └── rockneurotiko │ ├── input │ ├── input_test │ └── solve.ex ├── 2021 ├── day01 │ ├── Bigt0rch │ │ ├── Day_1_1.cs │ │ ├── Day_1_2.cs │ │ └── input.txt │ ├── FORGIS98 │ │ ├── SonarSweep.rs │ │ └── input.txt │ ├── aafrecct │ │ ├── __main__.py │ │ └── input │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day01.py │ │ └── input │ ├── ignaciobll │ │ ├── Day01.hs │ │ └── input │ ├── jasviers │ │ ├── input │ │ └── main.py │ ├── jfagoagas │ │ ├── day01.go │ │ ├── go.mod │ │ ├── go.sum │ │ └── input │ ├── rockneurotiko │ │ └── solve.ex │ ├── samgh96 │ │ └── day01.go │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day02 │ ├── Bigt0rch │ │ ├── Day_2_1.cs │ │ ├── Day_2_2.cs │ │ └── input.txt │ ├── FORGIS98 │ │ ├── Dive.rs │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day02.py │ │ └── input │ ├── ignaciobll │ │ ├── Day02.hs │ │ └── input │ ├── jasviers │ │ ├── input │ │ └── main.py │ ├── jfagoagas │ │ ├── day02.go │ │ ├── go.mod │ │ └── input │ ├── rockneurotiko │ │ └── solve.ex │ ├── samgh96 │ │ └── day02.go │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day03 │ ├── FORGIS98 │ │ ├── BinaryDiagnostic.rs │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day03.py │ │ └── input │ ├── jasviers │ │ ├── input │ │ └── main.py │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ ├── samgh96 │ │ ├── day03.go │ │ └── input.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ ├── main.go │ │ ├── main.py │ │ └── wtf_version.py ├── day04 │ ├── FORGIS98 │ │ ├── GiantSquid.kt │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day04.py │ │ └── input │ ├── ignaciobll │ │ ├── Day04.hs │ │ └── input │ ├── jasviers │ │ ├── input │ │ └── main.py │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ ├── samgh96 │ │ ├── day04.go │ │ └── input.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day05 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day05.py │ │ └── input │ ├── ignaciobll │ │ ├── Day05.hs │ │ └── input │ ├── jasviers │ │ ├── input │ │ └── main.py │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ ├── main.go │ │ ├── plot_with_diagonals.png │ │ └── plot_without_diagonals.png ├── day06 │ ├── FORGIS98 │ │ ├── Lanternfish.py │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day06.py │ │ └── input │ ├── ignaciobll │ │ ├── Day06.hs │ │ └── input │ ├── jasviers │ │ ├── input │ │ └── main.py │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day07 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day07.py │ │ └── input │ ├── ignaciobll │ │ ├── Day07.hs │ │ ├── day07 │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day08 │ ├── FORGIS98 │ │ ├── SevenSegmentSearch.rs │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day08.py │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day09 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day09.py │ │ └── input │ ├── rockneurotiko │ │ └── solve.ex │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ ├── main.go │ │ └── plot.png ├── day10 │ ├── FORGIS98 │ │ ├── SyntaxScoring.py │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day10.py │ │ └── input │ ├── ignaciobll │ │ ├── Day10.hs │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ ├── samgh96 │ │ ├── day10.go │ │ └── input.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day11 │ ├── FORGIS98 │ │ ├── DumboOctopus.py │ │ └── input.txt │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day11.py │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ ├── rockneurotiko │ │ └── solve.ex │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day12 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day12.py │ │ └── input │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day13 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day13.py │ │ └── input │ ├── ignaciobll │ │ ├── Day13.hs │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input │ │ └── main.go │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day14 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day14.py │ │ └── input │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day15 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day15.py │ │ └── input │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day16 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day16.py │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ └── skgsergio │ │ ├── bitsparser.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day17 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day17.py │ │ └── input │ └── skgsergio │ │ ├── example │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day18 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day18.py │ │ └── input │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day19 │ ├── andsanmar.rs │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day20 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day20.py │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day21 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day21.py │ │ └── input │ ├── jfagoagas │ │ ├── go.mod │ │ ├── input │ │ └── main.go │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day22 │ ├── andsanmar.rs │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day23 │ └── casamatechs │ │ └── input ├── day24 │ ├── andsanmar.rs │ ├── casamatechs │ │ ├── day24.py │ │ └── input │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go └── day25 │ ├── andsanmar.rs │ ├── casamatechs │ ├── day25.py │ └── input │ ├── jfagoagas │ ├── go.mod │ ├── input │ └── main.go │ └── skgsergio │ ├── go.mod │ ├── go.sum │ ├── input.txt │ └── main.go ├── 2022 ├── andsanmar │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── day01.rs │ │ ├── day02.rs │ │ ├── day03.rs │ │ ├── day04.rs │ │ ├── day05.rs │ │ ├── day06.rs │ │ ├── day07.rs │ │ ├── day08.rs │ │ ├── day09.rs │ │ ├── day10.rs │ │ ├── day11.rs │ │ ├── day12.rs │ │ ├── day13.rs │ │ ├── day14.rs │ │ └── day15.rs ├── day01 │ ├── aafrecct │ │ ├── input │ │ └── main.nim │ ├── cuwano │ │ ├── Makefile │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── mix.lock │ │ ├── test │ │ │ ├── cuwano_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── jfagoagas │ │ ├── day01.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day02 │ ├── aafrecct │ │ ├── input │ │ ├── main │ │ └── main.nim │ ├── cuwano │ │ ├── Makefile │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── test │ │ │ ├── cuwano_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── jfagoagas │ │ ├── day02.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day03 │ ├── aafrecct │ │ ├── input │ │ └── main.nim │ ├── cuwano │ │ ├── Makefile │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── test │ │ │ ├── cuwano_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── jfagoagas │ │ ├── day03.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day04 │ ├── aafrecct │ │ ├── input │ │ └── main.nim │ ├── cuwano │ │ ├── Makefile │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── test │ │ │ ├── cuwano_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── jfagoagas │ │ ├── day04.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day05 │ ├── aafrecct │ │ ├── input │ │ └── main.nim │ ├── cuwano │ │ ├── Makefile │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── test │ │ │ ├── cuwano_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── jfagoagas │ │ ├── day05.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day06 │ ├── aafrecct │ │ ├── input │ │ └── main.nim │ ├── cuwano │ │ ├── Makefile │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── test │ │ │ ├── cuwano_test.exs │ │ │ └── test_helper.exs │ │ └── test_input │ ├── jfagoagas │ │ ├── day06.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day07 │ ├── jfagoagas │ │ ├── day07.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day08 │ ├── jfagoagas │ │ ├── day08.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── combined.png │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ ├── main.go │ │ ├── patch.png │ │ └── visible.png ├── day09 │ ├── jfagoagas │ │ ├── day09.go │ │ ├── go.mod │ │ ├── input.txt │ │ └── input_test.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day10 │ ├── jfagoagas │ │ ├── day10.go │ │ ├── go.mod │ │ ├── input.txt │ │ ├── input_test_1.txt │ │ └── input_test_2.txt │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day11 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day12 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day13 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day14 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day15 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day16 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day17 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day18 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day19 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day20 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go ├── day21 │ └── skgsergio │ │ ├── go.mod │ │ ├── go.sum │ │ ├── input.txt │ │ └── main.go └── day23 │ └── skgsergio │ ├── go.mod │ ├── go.sum │ ├── input.txt │ └── main.go ├── 2023 ├── andsanmar │ ├── Cargo.toml │ └── src │ │ └── day01.rs ├── day01 │ └── cuwano │ │ ├── README.md │ │ ├── input │ │ ├── lib │ │ └── cuwano.ex │ │ ├── mix.exs │ │ ├── test │ │ ├── cuwano_test.exs │ │ └── test_helper.exs │ │ └── test_input └── day02 │ └── cuwano │ ├── README.md │ ├── input │ ├── lib │ └── cuwano.ex │ ├── mix.exs │ ├── test │ ├── cuwano_test.exs │ └── test_helper.exs │ └── test_input ├── 2024 ├── day01 │ ├── devcexx │ │ ├── .projectile │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── input │ │ └── main.rs │ └── ignaciobll │ │ ├── flake.lock │ │ ├── flake.nix │ │ ├── input.txt │ │ └── main.cu ├── day02 │ └── devcexx │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── input │ │ └── main.rs ├── day03 │ └── devcexx │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── input │ │ └── main.rs └── day04 │ └── devcexx │ ├── Cargo.lock │ ├── Cargo.toml │ ├── input │ └── main.rs ├── .gitignore └── Readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2018/*/ignaciobll/* 2 | !2018/*/ignaciobll/*.* 3 | 2018/*/ignaciobll/input.txt 4 | 2018/*/ignaciobll/test.txt 5 | 6 | *~ 7 | *.java 8 | *.php 9 | .* 10 | \#* 11 | *.pyc 12 | __pycache__ 13 | venv 14 | *.hi 15 | *.o -------------------------------------------------------------------------------- /2016/day01/cesar/input: -------------------------------------------------------------------------------- 1 | R4, R3, L3, L2, L1, R1, L1, R2, R3, L5, L5, R4, L4, R2, R4, L3, R3, L3, R3, R4, R2, L1, R2, L3, L2, L1, R3, R5, L1, L4, R2, L4, R3, R1, R2, L5, R2, L189, R5, L5, R52, R3, L1, R4, R5, R1, R4, L1, L3, R2, L2, L3, R4, R3, L2, L5, R4, R5, L2, R2, L1, L3, R3, L4, R4, R5, L1, L1, R3, L5, L2, R76, R2, R2, L1, L3, R189, L3, L4, L1, L3, R5, R4, L1, R1, L1, L1, R2, L4, R2, L5, L5, L5, R2, L4, L5, R4, R4, R5, L5, R3, L1, L3, L1, L1, L3, L4, R5, L3, R5, R3, R3, L5, L5, R3, R4, L3, R3, R1, R3, R2, R2, L1, R1, L3, L3, L3, L1, R2, L1, R4, R4, L1, L1, R3, R3, R4, R1, L5, L2, R2, R3, R2, L3, R4, L5, R1, R4, R5, R4, L4, R1, L3, R1, R3, L2, L3, R1, L2, R3, L3, L1, L3, R4, L4, L5, R3, R5, R4, R1, L2, R3, R5, L5, L4, L1, L1 -------------------------------------------------------------------------------- /2016/day02/andsanmar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2016/day02/andsanmar -------------------------------------------------------------------------------- /2016/day03/andsanmar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2016/day03/andsanmar -------------------------------------------------------------------------------- /2016/day03/andsanmar.rs~: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn main() { 4 | let r = fs::read_to_string("input").unwrap(); 5 | let valid_triangles : Vec<(u16,u16,u16)> = r.lines().map(|l| { 6 | let mut t : Vec = l.split_whitespace().map(|n| n.parse::().unwrap()).collect(); 7 | t.sort(); 8 | (t[0], t[1], t[2]) 9 | }).collect(); 10 | println!("{}", valid_triangles.len()); 11 | } 12 | -------------------------------------------------------------------------------- /2016/day03/rock/triangules.js: -------------------------------------------------------------------------------- 1 | fs = require('fs'); 2 | 3 | function validTriangle(sides) { 4 | if (sides.length != 3) { 5 | console.log("wat: ", sides); 6 | return false 7 | } 8 | 9 | var x = sides[0], 10 | y = sides[1], 11 | z = sides[2]; 12 | 13 | return x + y > z && 14 | x + z > y && 15 | y + z > x; 16 | } 17 | 18 | function analyze(data) { 19 | var validT = data.split("\n").map(x => x.trim().split(" ").filter(x => x != "").map(x => parseInt(x))).filter(validTriangle); 20 | return validT.length; 21 | } 22 | 23 | 24 | fs.readFile("input.txt", 'utf8', (err, data) => { 25 | if (err) { 26 | console.log("Error"); 27 | } else { 28 | console.log(analyze(data)); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /2016/day05/andsanmar/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day05" 3 | version = "0.1.0" 4 | authors = ["Andrés Sánchez "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | rust-crypto = "*" -------------------------------------------------------------------------------- /2016/day06/rock/main.jl: -------------------------------------------------------------------------------- 1 | import DataStructures.counter 2 | 3 | inp = Array{Char}(8, 2) 4 | 5 | f = open("input.txt") 6 | for ln in eachline(f) 7 | ar = collect(strip(ln)) 8 | inp = hcat(ar, inp) 9 | end 10 | 11 | for j = 1:size(inp, 1) 12 | 13 | winner = '\0'::Char 14 | winn = 10000 15 | 16 | cs = counter(inp[j,:]) 17 | 18 | for k in keys(cs) 19 | if k != '\0' && cs[k] < winn 20 | winner = k 21 | winn = cs[k] 22 | end 23 | end 24 | 25 | print(winner) 26 | end 27 | 28 | print("\n") 29 | 30 | # Answer1: tzstqsua 31 | # Answer2: myregdnr 32 | -------------------------------------------------------------------------------- /2016/day07/rock/input2.txt: -------------------------------------------------------------------------------- 1 | abba[mnop]qrst 2 | abcd[bddb]xyyx 3 | aaaa[qwer]tyui 4 | ioxxoj[asdfgh]zxcvbn 5 | -------------------------------------------------------------------------------- /2016/day07/rock/tls.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | valid = re.compile(r"([a-z])([a-z])\2\1") 4 | 5 | data = [] 6 | with open("input.txt") as f: 7 | data = f.readlines() 8 | 9 | n = 0 10 | for line in data: 11 | line = line.strip() 12 | print(line) 13 | finds = [m.start(0) for m in valid.finditer(line)] 14 | finds = [x for x in finds if line[x] != line[x + 1]] 15 | if len(finds) > 0: 16 | opens = [m.start(0) for m in re.finditer("\[", line)] 17 | closes = [m.start(0) for m in re.finditer("\]", line)] 18 | parens = list(zip(opens, closes)) 19 | ok = True 20 | for findi in finds: 21 | print(findi) 22 | print(parens) 23 | ok = ok and not any([findi > x and findi < y for (x, y) in parens]) 24 | if ok: 25 | n += 1 26 | print(n) 27 | -------------------------------------------------------------------------------- /2017/day01/cuwano/day1.ex: -------------------------------------------------------------------------------- 1 | defmodule AdventCode do 2 | def sum([x|_] = xs) do 3 | megasum xs, x 4 | end 5 | 6 | def megasum([x,x|xs], h), do: x + megasum([x|xs], h) 7 | def megasum([_,x|xs], h), do: megasum([x|xs], h) 8 | def megasum([x], x), do: x 9 | def megasum(_, _), do: 0 10 | end 11 | -------------------------------------------------------------------------------- /2017/day01/cuwano/day1.hs: -------------------------------------------------------------------------------- 1 | sum' :: (Num a, Eq a) => [a] -> a 2 | sum' xs@(x:_) = megasum xs x 3 | 4 | megasum :: (Num a, Eq a) => [a] -> a -> a 5 | megasum [x] y 6 | | x == y = x 7 | | otherwise = 0 8 | megasum (x:y:xs) z 9 | | x == y = x + megasum (y:xs) z 10 | | otherwise = megasum (y:xs) z 11 | -------------------------------------------------------------------------------- /2017/day01/foldr/part1/main.rb: -------------------------------------------------------------------------------- 1 | numbers = gets.chomp.split('').map(&:to_i) 2 | acc = 0 3 | numbers.each_index do |i| 4 | j = (i+1) % numbers.length 5 | 6 | acc += numbers[i] if numbers[i] == numbers[j] 7 | end 8 | puts acc 9 | -------------------------------------------------------------------------------- /2017/day01/foldr/part2/main.rb: -------------------------------------------------------------------------------- 1 | numbers = gets.chomp.split('').map(&:to_i) 2 | acc = 0 3 | numbers.each_index do |i| 4 | j = (i+numbers.length/2) % numbers.length 5 | 6 | acc += numbers[i] if numbers[i] == numbers[j] 7 | end 8 | puts acc 9 | -------------------------------------------------------------------------------- /2017/day01/paloma/n1.hs: -------------------------------------------------------------------------------- 1 | import Data.Char 2 | 3 | -- Part 1 4 | captcha :: String -> Int 5 | captcha input = sum (matching2 (parInput) 2) 6 | where parInput = map digitToInt input 7 | 8 | -- Part 2 9 | captcha2 :: String -> Int 10 | captcha2 input = sum (matching2 (parInput) (distance parInput)) 11 | where parInput = map digitToInt input 12 | 13 | distance :: [Int] -> Int 14 | distance list = (length list) `div` 2 15 | 16 | matching2 :: [Int] -> Int -> [Int] 17 | matching2 input dist = map (\(e, n) -> (if ((input !! n) == (input !! ((n + dist) `mod` (length input)))) then e else 0 )) (zip input [0..]) 18 | -------------------------------------------------------------------------------- /2017/day02/andsanmar.py: -------------------------------------------------------------------------------- 1 | with open("input", "r") as file: 2 | s = 0 3 | s2 = 0 4 | for line in file: 5 | numbers = list(map(lambda x: int(x), line.split())) 6 | s = s + max(numbers) - min(numbers) 7 | for x in numbers: 8 | for y in numbers: 9 | if(x != y and (x % y == 0 or y % x == 0)): 10 | if(x > y): 11 | s2 = s2 + x / y 12 | else: 13 | s2 = s2 + y / x 14 | print(s) 15 | print(s2/2) 16 | -------------------------------------------------------------------------------- /2017/day02/cuwano/day2.hs: -------------------------------------------------------------------------------- 1 | checksum :: (Num a, Ord a) => [[a]] -> a 2 | checksum = foldl (\acc x -> acc + sumRow x) 0 3 | 4 | sumRow :: (Num a, Ord a) => [a] -> a 5 | sumRow x = abs (largest x - smallest x) 6 | 7 | largest :: (Num a, Ord a) => [a] -> a 8 | largest (x:xs) = foldl (\acc x -> if x > acc then x else acc) x xs 9 | 10 | smallest :: (Num a, Ord a) => [a] -> a 11 | smallest (x:xs) = foldl (\acc x -> if x < acc then x else acc) x xs 12 | -------------------------------------------------------------------------------- /2017/day02/cuwano/day2_part2.ex: -------------------------------------------------------------------------------- 1 | defmodule AdventCode do 2 | def check(elem, list) do 3 | case Enum.filter(list, fn x -> rem(x, elem) == 0 end) do 4 | [] -> :nope 5 | [x] -> {:found, x, elem} 6 | end 7 | end 8 | 9 | def getNumbers([h|rest]) do 10 | case check(h, rest) do 11 | {:found, a, b} -> {a, b} 12 | :nope -> getNumbers(rest ++ [h]) 13 | end 14 | end 15 | 16 | def checkRow(row, acc) do 17 | with {a, b} <- getNumbers(row), 18 | c <- a/b do 19 | acc + c 20 | end 21 | end 22 | 23 | def checksum(x), do: List.foldl(x, 0, &checkRow/2) 24 | end 25 | -------------------------------------------------------------------------------- /2017/day02/foldr/part1.rb: -------------------------------------------------------------------------------- 1 | checksum = 0 2 | while line = gets 3 | line = line.chomp.split(' ').map(&:to_i) 4 | checksum += line.max - line.min 5 | end 6 | puts checksum 7 | 8 | -------------------------------------------------------------------------------- /2017/day02/foldr/part2.rb: -------------------------------------------------------------------------------- 1 | a=[] 2 | puts loop{if l=gets then a< Bool 5 | correctPassPhrase pp = length ppw == length pp 6 | where ppw = unwords . toList . fromList . words $ pp 7 | 8 | 9 | correctPassPhrase' :: String -> Bool 10 | correctPassPhrase' pp = (length. fromList $ ppw) == (length ppw) 11 | where ppw = words pp 12 | 13 | 14 | nCorrects = length . filter id . map correctPassPhrase 15 | 16 | nCorrects' lpp = foldr (countCorrect) 0 lpp 17 | where countCorrect pp c = if correctPassPhrase' pp then c + 1 else c 18 | 19 | 20 | test1 = ["aa bb cc dd ee", "aa bb cc dd aa", "aa bb cc dd aaa"] 21 | 22 | 23 | main :: IO () 24 | main = do 25 | input <- getContents 26 | putStrLn . show . nCorrects' . lines $ input 27 | -------------------------------------------------------------------------------- /2017/day04/ignacio/passphrase.py: -------------------------------------------------------------------------------- 1 | from functools import reduce 2 | 3 | with open('input.txt', 'r') as pphrases: 4 | correct1 = 0 5 | correct2 = 0 6 | for pphrase in pphrases: 7 | pp = pphrase.split() 8 | if len(set(pp)) == len(pp): 9 | correct1 = correct1 + 1 10 | pps = ["".join(sorted(w)) for w in pp] 11 | if len(set(pps)) == len(pp): 12 | correct2 = correct2 + 1 13 | print("Star 1:", correct1) 14 | print("Star 2:", correct2) 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /2017/day04/luis/day4.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import System.IO (getContents) 4 | import Data.List 5 | 6 | checker :: [String] -> Bool 7 | checker = (==) [] . filter (> 1) . map length . group . sort 8 | 9 | noanagram :: [String] -> Bool 10 | noanagram = checker . map sort 11 | 12 | passphrasses :: (a -> Bool) -> [a] -> Int 13 | passphrasses f = length . filter id . map f 14 | 15 | main :: IO () 16 | main = do 17 | input <- getContents 18 | putStrLn . show . passphrasses checker . map words . lines $ input 19 | putStrLn . show . passphrasses noanagram . map words . lines $ input 20 | -------------------------------------------------------------------------------- /2017/day05/andsanmar.py: -------------------------------------------------------------------------------- 1 | with open("input", "r") as file: 2 | for line in file: 3 | nums = list(map(lambda x: int(x), line.split())) 4 | pointer = 0 5 | lastPointer = pointer 6 | steps = 0 7 | while (pointer < len(nums) and pointer >= 0): 8 | pointer = pointer + nums[pointer] 9 | nums[lastPointer] = nums[lastPointer] + 1 10 | lastPointer = pointer 11 | steps = steps + 1 12 | print(steps) 13 | -------------------------------------------------------------------------------- /2017/day05/andsanmar_2.py: -------------------------------------------------------------------------------- 1 | with open("input", "r") as file: 2 | for line in file: 3 | nums = list(map(lambda x: int(x), line.split())) 4 | pointer = 0 5 | lastPointer = pointer 6 | steps = 0 7 | while (pointer < len(nums) and pointer >= 0): 8 | pointer = pointer + nums[pointer] 9 | if(nums[lastPointer] >= 3): 10 | nums[lastPointer] = nums[lastPointer] - 1 11 | else: 12 | nums[lastPointer] = nums[lastPointer] + 1 13 | lastPointer = pointer 14 | steps = steps + 1 15 | print(steps) 16 | -------------------------------------------------------------------------------- /2017/day05/foldr/part1.rb: -------------------------------------------------------------------------------- 1 | class MV 2 | attr_reader :pc, :mem, :steps 3 | 4 | def initialize(mem) 5 | @pc = 0 6 | @mem = mem 7 | @steps = 0 8 | end 9 | 10 | def step 11 | @steps += 1 12 | val = @mem[@pc] 13 | @mem[@pc] += 1 14 | @pc += val 15 | if @pc >= @mem.length 16 | nil 17 | else 18 | @pc 19 | end 20 | end 21 | 22 | def to_s 23 | @mem.each_with_index.map {|x,i| if i == @pc then "(#{x})" else "#{x}" end}.join ' ' 24 | end 25 | end 26 | 27 | mem = [] 28 | while line = gets 29 | mem << line.chomp.to_i 30 | end 31 | 32 | mv = MV.new mem 33 | puts "#{mv.pc}/#{mv.mem.length}" while mv.step 34 | 35 | puts mv.steps 36 | -------------------------------------------------------------------------------- /2017/day05/foldr/part2.rb: -------------------------------------------------------------------------------- 1 | class MV 2 | attr_reader :pc, :mem, :steps 3 | 4 | def initialize(mem) 5 | @pc = 0 6 | @mem = mem 7 | @steps = 0 8 | end 9 | 10 | def step 11 | @steps += 1 12 | val = @mem[@pc] 13 | if val >= 3 14 | @mem[@pc] -= 1 15 | else 16 | @mem[@pc] += 1 17 | end 18 | @pc += val 19 | if @pc >= @mem.length 20 | nil 21 | else 22 | @pc 23 | end 24 | end 25 | 26 | def to_s 27 | @mem.each_with_index.map {|x,i| if i == @pc then "[#{x}]" else " #{x} " end}.join ' ' 28 | end 29 | end 30 | 31 | mem = [] 32 | while line = gets 33 | mem << line.chomp.to_i 34 | end 35 | 36 | mv = MV.new mem 37 | puts "#{mv.pc}/#{mv.mem.length}" while mv.step 38 | #puts "#{mv}" while mv.step 39 | 40 | puts mv.steps 41 | -------------------------------------------------------------------------------- /2017/day05/foldr/test: -------------------------------------------------------------------------------- 1 | 0 2 | 3 3 | 0 4 | 1 5 | -3 6 | -------------------------------------------------------------------------------- /2017/day05/rubenaguadoc/Day5.py: -------------------------------------------------------------------------------- 1 | file = open('jumpStack', 'r') 2 | rawInpt = file.read() 3 | 4 | rawInpt = rawInpt.splitlines() 5 | preIndx = 0 6 | indx = 0 7 | count = 0 8 | inpt = [int(x) for x in rawInpt] 9 | while(indx < len(inpt) and indx >= 0): 10 | count += 1 11 | indx += inpt[indx] 12 | inpt[preIndx] += 1 13 | preIndx = indx 14 | 15 | print(count) 16 | 17 | 18 | preIndx = 0 19 | indx = 0 20 | count = 0 21 | inpt = [int(x) for x in rawInpt] 22 | while(indx < len(inpt) and indx >= 0): 23 | count += 1 24 | indx += inpt[indx] 25 | if(inpt[preIndx] < 3): 26 | inpt[preIndx] += 1 27 | else: 28 | inpt[preIndx] -= 1 29 | preIndx = indx 30 | 31 | print(count) 32 | -------------------------------------------------------------------------------- /2017/day05/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | 0 2 | 3 3 | 0 4 | 1 5 | -3 6 | 7 | -------------------------------------------------------------------------------- /2017/day05/skgsergio/maze.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | 5 | 6 | def solve(l, part_2=False): 7 | idx = 0 8 | steps = 0 9 | 10 | while 0 <= idx < len(l): 11 | n = l[idx] 12 | 13 | l[idx] = n - 1 if part_2 and n >= 3 else n + 1 14 | 15 | idx += n 16 | steps += 1 17 | 18 | return steps 19 | 20 | 21 | def part_1(l): 22 | return solve(l) 23 | 24 | 25 | def part_2(jumps): 26 | return solve(l, True) 27 | 28 | 29 | if __name__ == '__main__': 30 | if len(sys.argv) < 2: 31 | print("Usage: {} ".format(sys.argv[0]), 32 | file=sys.stderr) 33 | 34 | l = None 35 | with open(sys.argv[1], 'r') as f: 36 | l = list(map(int, f.read().split())) 37 | 38 | print(part_1(l[:])) 39 | print(part_2(l[:])) 40 | -------------------------------------------------------------------------------- /2017/day06/andsanmar.py: -------------------------------------------------------------------------------- 1 | import copy 2 | input = [5, 1, 10, 0, 1, 7, 13, 14, 3, 12, 8, 10, 7, 12, 0, 6] 3 | seen = [] 4 | steps = 0 5 | while input not in seen: 6 | seen.append(copy.deepcopy(input)) 7 | acum = max(input) 8 | index = input.index(acum) 9 | input[index] = 0 10 | index = (index + 1) % len(input) 11 | while acum != 0: 12 | input[index] = input[index] + 1 13 | acum = acum - 1 14 | index = (index + 1) % len(input) 15 | steps = steps + 1 16 | print(steps) 17 | print(steps-seen.index(input)) 18 | -------------------------------------------------------------------------------- /2017/day06/foldr/input: -------------------------------------------------------------------------------- 1 | 10 3 15 10 5 15 5 15 9 2 5 8 5 2 3 6 2 | -------------------------------------------------------------------------------- /2017/day06/foldr/part1.rb: -------------------------------------------------------------------------------- 1 | require 'set' 2 | 3 | class Realloc 4 | attr_reader :steps 5 | 6 | def initialize(mem) 7 | @mem = mem 8 | @seen = Set.new 9 | @steps = 0 10 | end 11 | 12 | def step 13 | @steps += 1 14 | i = @mem.index(@mem.max) 15 | val = @mem[i] 16 | @mem[i] = 0 17 | val.times { 18 | i += 1 19 | @mem[i % @mem.length] += 1 20 | } 21 | if @seen.include? @mem 22 | nil 23 | else 24 | @seen << @mem 25 | end 26 | end 27 | 28 | def to_s 29 | @mem.join(' ') 30 | end 31 | end 32 | 33 | mem = gets.chomp.split(/\s+/).map(&:to_i) 34 | realloc = Realloc.new mem 35 | puts realloc while realloc.step 36 | 37 | puts realloc.steps 38 | -------------------------------------------------------------------------------- /2017/day06/foldr/test: -------------------------------------------------------------------------------- 1 | 0 2 7 0 2 | -------------------------------------------------------------------------------- /2017/day06/rubenaguadoc/Day6.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | inpt = "2 8 8 5 4 2 3 1 5 5 1 2 15 13 5 14" 4 | inpt = list(map(int, re.split(r'\t+', inpt))) 5 | states = [list(inpt)] 6 | seen = False 7 | count = 0 8 | 9 | while(not seen): 10 | bigest = max(inpt) 11 | indx = inpt.index(bigest) 12 | inpt[indx] = 0 13 | for i in range(1, bigest + 1, 1): 14 | stack = i + indx 15 | while(stack >= len(inpt)): 16 | stack -= len(inpt) 17 | inpt[stack] += 1 18 | for state in states: 19 | if(list(inpt) == state): 20 | seen = True 21 | states.append(list(inpt)) 22 | count += 1 23 | 24 | print(count) 25 | 26 | for index, state in enumerate(states): 27 | for index2, state2 in enumerate(states): 28 | if(state == state2 and not index == index2): 29 | print(index2 - index) 30 | -------------------------------------------------------------------------------- /2017/day06/skgsergio/input: -------------------------------------------------------------------------------- 1 | 2 8 8 5 4 2 3 1 5 5 1 2 15 13 5 14 2 | -------------------------------------------------------------------------------- /2017/day06/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | 0 2 7 0 2 | -------------------------------------------------------------------------------- /2017/day07/andsanmar.py: -------------------------------------------------------------------------------- 1 | with open("input", "r") as file: 2 | subprocesses = [] 3 | parents = [] 4 | for line in file: 5 | if("->" in line): 6 | proc = line.split("->") 7 | subp = proc[1].split(",") 8 | parents.append(proc[0].split()[0]) 9 | for s in subp: 10 | subprocesses.append(s.strip()) 11 | print(str(set(parents)-set(subprocesses))) 12 | -------------------------------------------------------------------------------- /2017/day07/foldr/test: -------------------------------------------------------------------------------- 1 | pbga (66) 2 | xhth (57) 3 | ebii (61) 4 | havc (66) 5 | ktlj (57) 6 | fwft (72) -> ktlj, cntj, xhth 7 | qoyq (66) 8 | padx (45) -> pbga, havc, qoyq 9 | tknk (41) -> ugml, padx, fwft 10 | jptl (61) 11 | ugml (68) -> gyxo, ebii, jptl 12 | gyxo (61) 13 | cntj (57) 14 | -------------------------------------------------------------------------------- /2017/day07/input_sample: -------------------------------------------------------------------------------- 1 | pbga (66) 2 | xhth (57) 3 | ebii (61) 4 | havc (66) 5 | ktlj (57) 6 | fwft (72) -> ktlj, cntj, xhth 7 | qoyq (66) 8 | padx (45) -> pbga, havc, qoyq 9 | tknk (41) -> ugml, padx, fwft 10 | jptl (61) 11 | ugml (68) -> gyxo, ebii, jptl 12 | gyxo (61) 13 | cntj (57) -------------------------------------------------------------------------------- /2017/day07/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | pbga (66) 2 | xhth (57) 3 | ebii (61) 4 | havc (66) 5 | ktlj (57) 6 | fwft (72) -> ktlj, cntj, xhth 7 | qoyq (66) 8 | padx (45) -> pbga, havc, qoyq 9 | tknk (41) -> ugml, padx, fwft 10 | jptl (61) 11 | ugml (68) -> gyxo, ebii, jptl 12 | gyxo (61) 13 | cntj (57) 14 | -------------------------------------------------------------------------------- /2017/day08/foldr/test: -------------------------------------------------------------------------------- 1 | b inc 5 if a > 1 2 | a inc 1 if b < 5 3 | c dec -10 if a >= 1 4 | c inc -20 if c == 10 5 | -------------------------------------------------------------------------------- /2017/day08/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | b inc 5 if a > 1 2 | a inc 1 if b < 5 3 | c dec -10 if a >= 1 4 | c inc -20 if c == 10 5 | 6 | -------------------------------------------------------------------------------- /2017/day09/andsanmar.py: -------------------------------------------------------------------------------- 1 | def score(text): 2 | 3 | 4 | 5 | with open("input", "r") as file: 6 | for line in file: 7 | print(str(score(line)) 8 | -------------------------------------------------------------------------------- /2017/day09/foldr/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean run tests 2 | 3 | all: clean run 4 | 5 | test: part2 tests 6 | @for t in `cat tests`; do echo $$t | ./part2 ; done 7 | 8 | run: part2 9 | @./part2 10 | 11 | %: %.hs 12 | @ghc $^ > /dev/null 13 | 14 | clean: 15 | @rm -f part{1,2}{,.hi,.o} 16 | -------------------------------------------------------------------------------- /2017/day09/foldr/tests: -------------------------------------------------------------------------------- 1 | {} 2 | {{{}}} 3 | {{},{}} 4 | {{{},{},{{}}}} 5 | {,,,} 6 | {{},{},{},{}} 7 | {{},{},{},{}} 8 | {{},{},{},{}} 9 | -------------------------------------------------------------------------------- /2017/day10/skgsergio/input: -------------------------------------------------------------------------------- 1 | 183,0,31,146,254,240,223,150,2,206,161,1,255,232,199,88 2 | -------------------------------------------------------------------------------- /2017/day11/foldr/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean run tests 2 | 3 | all: clean run 4 | 5 | test: part1 tests 6 | @for t in `cat tests`; do echo $$t | ./part2 ; done 7 | 8 | run: part2 9 | @./part2 10 | 11 | %: %.hs 12 | @ghc $^ > /dev/null 13 | 14 | clean: 15 | rm -f part{1,2}{,.hi,.o} 16 | -------------------------------------------------------------------------------- /2017/day11/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | se,sw,se,sw,sw 2 | -------------------------------------------------------------------------------- /2017/day12/andsanmar.py: -------------------------------------------------------------------------------- 1 | relations = {} 2 | with open("input_sample", "r") as file: 3 | for line in file: 4 | p = line.split("<->") 5 | s = p[1].split(",") 6 | right = [] 7 | for sub in s: 8 | right.append(int(sub)) 9 | k = p[0] 10 | relations[int(p[0])] = right 11 | # print(str(relations)) 12 | length = 1 13 | newlength = 0 14 | subprocesses = [0] 15 | while length != newlength: 16 | length = len(subprocesses) 17 | for x in subprocesses: 18 | for y in relations[x]: 19 | if y not in subprocesses: 20 | subprocesses.append(y) 21 | newlength = len(subprocesses) 22 | 23 | print(length) 24 | -------------------------------------------------------------------------------- /2017/day12/foldr/test: -------------------------------------------------------------------------------- 1 | 0 <-> 2 2 | 1 <-> 1 3 | 2 <-> 0, 3, 4 4 | 3 <-> 2, 4 5 | 4 <-> 2, 3, 6 6 | 5 <-> 6 7 | 6 <-> 4, 5 8 | -------------------------------------------------------------------------------- /2017/day12/input_sample: -------------------------------------------------------------------------------- 1 | 0 <-> 2 2 | 1 <-> 1 3 | 2 <-> 0, 3, 4 4 | 3 <-> 2, 4 5 | 4 <-> 2, 3, 6 6 | 5 <-> 6 7 | 6 <-> 4, 5 -------------------------------------------------------------------------------- /2017/day12/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | 0 <-> 2 2 | 1 <-> 1 3 | 2 <-> 0, 3, 4 4 | 3 <-> 2, 4 5 | 4 <-> 2, 3, 6 6 | 5 <-> 6 7 | 6 <-> 4, 5 8 | -------------------------------------------------------------------------------- /2017/day13/andsanmar.py: -------------------------------------------------------------------------------- 1 | with open("input", "r") as file: 2 | r = {} 3 | for line in file: 4 | a = line.split(":") 5 | r[int(a[0])] = int(a[1]) 6 | s = 0 7 | for x in r.keys(): 8 | if(x % (2*(r[x]-1)) == 0): 9 | s = x*r[x] + s 10 | print(s) 11 | f = False 12 | c = 0 13 | while(not f): 14 | f = True 15 | for x in r.keys(): 16 | if((c + x) % (2*(r[x]-1)) == 0): 17 | f = False 18 | if(f): 19 | print(c) 20 | c = c + 1 21 | -------------------------------------------------------------------------------- /2017/day13/andsanmar.result: -------------------------------------------------------------------------------- 1 | 3, 2, 4, 4 2 | MCM = 12 3 | 4 | estrategia: 5 | Para ver en cada uno de los esados cual es el resultado, tenemos que ver que el módulo sea igual al estado en el qe se encuentra al comenzar -------------------------------------------------------------------------------- /2017/day13/input: -------------------------------------------------------------------------------- 1 | 0: 3 2 | 1: 2 3 | 2: 4 4 | 4: 4 5 | 6: 5 6 | 8: 8 7 | 10: 6 8 | 12: 6 9 | 14: 8 10 | 16: 6 11 | 18: 6 12 | 20: 8 13 | 22: 12 14 | 24: 8 15 | 26: 8 16 | 28: 12 17 | 30: 8 18 | 32: 12 19 | 34: 9 20 | 36: 14 21 | 38: 12 22 | 40: 12 23 | 42: 12 24 | 44: 14 25 | 46: 14 26 | 48: 10 27 | 50: 14 28 | 52: 12 29 | 54: 14 30 | 56: 12 31 | 58: 17 32 | 60: 10 33 | 64: 14 34 | 66: 14 35 | 68: 12 36 | 70: 12 37 | 72: 18 38 | 74: 14 39 | 78: 14 40 | 82: 14 41 | 84: 24 42 | 86: 14 43 | 94: 14 -------------------------------------------------------------------------------- /2017/day13/input_sample: -------------------------------------------------------------------------------- 1 | 0: 3 2 | 1: 2 3 | 4: 4 4 | 6: 4 -------------------------------------------------------------------------------- /2017/day13/rubenaguadoc/Day13.py: -------------------------------------------------------------------------------- 1 | print('May take up to 45\'') 2 | # inpt = open('input', 'r') 3 | inpt = open('day13/rubenaguadoc/input', 'r') 4 | inpt = inpt.read().rstrip('\n') 5 | inpt = inpt.split('\n') 6 | lengths = {int(x.split(': ')[0]): (int(x.split(': ')[1]) - 1) * 2 for x in inpt} 7 | severity = None 8 | count = 0 9 | 10 | while not severity == 0: 11 | severity = 0 12 | for i in range(max(lengths.keys()) + 1): 13 | if i in lengths.keys(): 14 | if (i + count) % lengths[i] == 0: 15 | if count == 0: 16 | severity += int(i * (lengths[i] / 2 + 1)) 17 | else: 18 | severity = 1 19 | break 20 | 21 | if count == 0: 22 | print(severity) 23 | 24 | count += 1 25 | 26 | print(count - 1) 27 | -------------------------------------------------------------------------------- /2017/day13/rubenaguadoc/input: -------------------------------------------------------------------------------- 1 | 0: 4 2 | 1: 2 3 | 2: 3 4 | 4: 4 5 | 6: 6 6 | 8: 5 7 | 10: 6 8 | 12: 6 9 | 14: 6 10 | 16: 12 11 | 18: 8 12 | 20: 9 13 | 22: 8 14 | 24: 8 15 | 26: 8 16 | 28: 8 17 | 30: 12 18 | 32: 10 19 | 34: 8 20 | 36: 12 21 | 38: 10 22 | 40: 12 23 | 42: 12 24 | 44: 12 25 | 46: 12 26 | 48: 12 27 | 50: 14 28 | 52: 14 29 | 54: 12 30 | 56: 12 31 | 58: 14 32 | 60: 14 33 | 62: 14 34 | 66: 14 35 | 68: 14 36 | 70: 14 37 | 72: 14 38 | 74: 14 39 | 78: 18 40 | 80: 14 41 | 82: 14 42 | 88: 18 43 | 92: 17 44 | -------------------------------------------------------------------------------- /2017/day13/skgsergio/input: -------------------------------------------------------------------------------- 1 | 0: 3 2 | 1: 2 3 | 2: 4 4 | 4: 4 5 | 6: 5 6 | 8: 6 7 | 10: 6 8 | 12: 6 9 | 14: 6 10 | 16: 8 11 | 18: 8 12 | 20: 8 13 | 22: 8 14 | 24: 10 15 | 26: 8 16 | 28: 8 17 | 30: 12 18 | 32: 14 19 | 34: 12 20 | 36: 10 21 | 38: 12 22 | 40: 12 23 | 42: 9 24 | 44: 12 25 | 46: 12 26 | 48: 12 27 | 50: 12 28 | 52: 14 29 | 54: 14 30 | 56: 14 31 | 58: 12 32 | 60: 14 33 | 62: 14 34 | 64: 12 35 | 66: 14 36 | 70: 14 37 | 72: 14 38 | 74: 14 39 | 76: 14 40 | 80: 18 41 | 88: 20 42 | 90: 14 43 | 98: 17 44 | -------------------------------------------------------------------------------- /2017/day13/skgsergio/input_sample: -------------------------------------------------------------------------------- 1 | 0: 3 2 | 1: 2 3 | 4: 4 4 | 6: 4 5 | -------------------------------------------------------------------------------- /2017/day15/andsanmar.py: -------------------------------------------------------------------------------- 1 | a = 883 2 | b = 879 3 | c = 0 4 | for i in range(4*10**7): 5 | if((a % 2**16) == (b % 2**16)): 6 | c += 1 7 | a = (a * 16807) % 2147483647 8 | b = (b * 48271) % 2147483647 9 | print(c) 10 | -------------------------------------------------------------------------------- /2017/day15/andsanmar_2.py: -------------------------------------------------------------------------------- 1 | a = 883 2 | b = 879 3 | c = 0 4 | for i in range(5*10**6): 5 | if((a % 2**16) == (b % 2**16)): 6 | c += 1 7 | a = (a * 16807) % 2147483647 8 | b = (b * 48271) % 2147483647 9 | while(not a % 4 == 0): 10 | a = (a * 16807) % 2147483647 11 | while(not b % 8 == 0): 12 | b = (b * 48271) % 2147483647 13 | print(c) 14 | -------------------------------------------------------------------------------- /2017/day15/rubenaguadoc/Day15.py: -------------------------------------------------------------------------------- 1 | print('It may take a while... (Up to 100\')') 2 | inptA = 883 3 | inptB = 879 4 | # Example 5 | # inptA = 65 6 | # inptB = 8921 7 | 8 | pA = inptA 9 | pB = inptB 10 | factorA = 16807 11 | factorB = 48271 12 | div = 2147483647 13 | count = 0 14 | 15 | for i in range(40000000): 16 | pA = (pA * factorA) % div 17 | pB = (pB * factorB) % div 18 | if bin(pA)[-16:] == bin(pB)[-16:]: 19 | count += 1 20 | 21 | print(count) 22 | 23 | pA = inptA 24 | pB = inptB 25 | count = 0 26 | 27 | for i in range(5000000): 28 | pA = (pA * factorA) % div 29 | pB = (pB * factorB) % div 30 | while not pA % 4 == 0: 31 | pA = (pA * factorA) % div 32 | while not pB % 8 == 0: 33 | pB = (pB * factorB) % div 34 | if bin(pA)[-16:] == bin(pB)[-16:]: 35 | count += 1 36 | 37 | print(count) 38 | -------------------------------------------------------------------------------- /2017/day15/skgsergio/generators.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | 5 | 6 | def gen(n, x, m=1): 7 | while True: 8 | n = n * x % 2147483647 9 | if n % m == 0: 10 | yield n & 0xFFFF 11 | 12 | 13 | def solve(a_n, b_n, rnds, m_a=1, m_b=1): 14 | a = gen(a_n, 16807, m_a) 15 | b = gen(b_n, 48271, m_b) 16 | c = 0 17 | 18 | for _ in range(rnds): 19 | if next(a) == next(b): 20 | c += 1 21 | 22 | return c 23 | 24 | 25 | if __name__ == '__main__': 26 | if len(sys.argv) < 2: 27 | print("Usage: {} ".format(sys.argv[0]), 28 | file=sys.stderr) 29 | exit(1) 30 | 31 | a = int(sys.argv[1]) 32 | b = int(sys.argv[2]) 33 | print("Part 1: {}".format(solve(a, b, 40000000))) 34 | print("Part 2: {}".format(solve(a, b, 5000000, 4, 8))) 35 | -------------------------------------------------------------------------------- /2017/day15/skgsergio/input: -------------------------------------------------------------------------------- 1 | Generator A starts with 516 2 | Generator B starts with 190 3 | -------------------------------------------------------------------------------- /2017/day17/andsanmar.py: -------------------------------------------------------------------------------- 1 | a = [0] 2 | pos = 0 3 | steps = 337 4 | for i in range(2017): 5 | pos = (pos + steps) % len(a) 6 | a.insert(pos + 1, i+1) 7 | pos += 1 8 | print(str(a[a.index(2017)+1])) 9 | 10 | 11 | curl = 1 12 | pos = 0 13 | out = 0 14 | for i in range(50000000): 15 | to_ins = i+1 16 | new = (pos + steps) % curl 17 | new += 1 18 | if new == 1: 19 | out = to_ins 20 | pos = new 21 | curl += 1 22 | print(out) 23 | -------------------------------------------------------------------------------- /2017/day17/rubenaguadoc/Day17.py: -------------------------------------------------------------------------------- 1 | print('May take a while... (Up to 35\')') 2 | inpt = 329 3 | # inpt = 3 4 | 5 | vortex = [0] 6 | pos = 0 7 | count = 1 8 | 9 | for _ in range(2017): 10 | pos = (pos + inpt) % len(vortex) + 1 11 | vortex.insert(pos, count) 12 | count += 1 13 | 14 | print(vortex[pos + 1]) 15 | 16 | lenVortex = 1 17 | pos = 0 18 | count = 1 19 | 20 | for _ in range(50000000): 21 | pos = (pos + inpt) % lenVortex + 1 22 | if pos == 1: 23 | res = count 24 | lenVortex += 1 25 | count += 1 26 | 27 | print(res) 28 | -------------------------------------------------------------------------------- /2017/day17/skgsergio/spinlock.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | 5 | 6 | def part_1(n): 7 | s = [0] 8 | p = 0 9 | 10 | for i in range(2017): 11 | p = ((p + n) % len(s)) + 1 12 | s.insert(p, i + 1) 13 | 14 | return s[p + 1] 15 | 16 | 17 | def part_2(n): 18 | p = 0 19 | s = 0 20 | 21 | for i in range(50000000): 22 | p = ((p + n) % (i + 1)) + 1 23 | 24 | if p == 1: 25 | s = i + 1 26 | 27 | return s 28 | 29 | 30 | if __name__ == '__main__': 31 | if len(sys.argv) < 2: 32 | print("Usage: {} ".format(sys.argv[0]), 33 | file=sys.stderr) 34 | exit(1) 35 | 36 | n = int(sys.argv[1]) 37 | 38 | print("Part 1: {}".format(part_1(n))) 39 | print("Part 2: {}".format(part_2(n))) 40 | -------------------------------------------------------------------------------- /2017/day18/rubenaguadoc/input: -------------------------------------------------------------------------------- 1 | set i 31 2 | set a 1 3 | mul p 17 4 | jgz p p 5 | mul a 2 6 | add i -1 7 | jgz i -2 8 | add a -1 9 | set i 127 10 | set p 826 11 | mul p 8505 12 | mod p a 13 | mul p 129749 14 | add p 12345 15 | mod p a 16 | set b p 17 | mod b 10000 18 | snd b 19 | add i -1 20 | jgz i -9 21 | jgz a 3 22 | rcv b 23 | jgz b -1 24 | set f 0 25 | set i 126 26 | rcv a 27 | rcv b 28 | set p a 29 | mul p -1 30 | add p b 31 | jgz p 4 32 | snd a 33 | set a b 34 | jgz 1 3 35 | snd b 36 | set f 1 37 | add i -1 38 | jgz i -11 39 | snd a 40 | jgz f -16 41 | jgz a -19 42 | -------------------------------------------------------------------------------- /2017/day18/skgsergio/input: -------------------------------------------------------------------------------- 1 | set i 31 2 | set a 1 3 | mul p 17 4 | jgz p p 5 | mul a 2 6 | add i -1 7 | jgz i -2 8 | add a -1 9 | set i 127 10 | set p 622 11 | mul p 8505 12 | mod p a 13 | mul p 129749 14 | add p 12345 15 | mod p a 16 | set b p 17 | mod b 10000 18 | snd b 19 | add i -1 20 | jgz i -9 21 | jgz a 3 22 | rcv b 23 | jgz b -1 24 | set f 0 25 | set i 126 26 | rcv a 27 | rcv b 28 | set p a 29 | mul p -1 30 | add p b 31 | jgz p 4 32 | snd a 33 | set a b 34 | jgz 1 3 35 | snd b 36 | set f 1 37 | add i -1 38 | jgz i -11 39 | snd a 40 | jgz f -16 41 | jgz a -19 42 | -------------------------------------------------------------------------------- /2018/day01/andsanmar.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.IntSet as IntSet 2 | 3 | star2 :: [Int] -> Int 4 | star2 x = fset (concat $ repeat x) (IntSet.empty) 0 5 | 6 | fset :: [Int] -> IntSet.IntSet -> Int -> Int 7 | fset (l:ls) xs s = if IntSet.member s xs then s else fset ls (IntSet.insert s xs) cur_sum 8 | where cur_sum = s + l 9 | fset [] _ _ = 0 10 | 11 | read' :: String -> Int 12 | read' ('+':x) = read x 13 | read' x = read x 14 | 15 | main :: IO() 16 | main = do 17 | text <- readFile "input" 18 | let nums = Prelude.map read' $ lines text 19 | putStrLn $ show $ sum nums 20 | putStrLn $ show $ star2 nums 21 | -------------------------------------------------------------------------------- /2018/day01/david-jl/01.js: -------------------------------------------------------------------------------- 1 | let fs = require("fs"); 2 | const datos = fs.readFileSync("./input.txt").toString().split("\n"); 3 | 4 | let parte1 = () =>{ 5 | let res = 0; 6 | datos.forEach(num => res += Number(num)); 7 | return res; 8 | }; 9 | 10 | let prueba = [+7, +7, -2, -7, -4]; 11 | 12 | let parte2 = () => { 13 | let memoria = []; 14 | let res = 0, i = 0; 15 | let long = datos.length; 16 | while(true){ 17 | res += Number(datos[i%long]); 18 | if(memoria.includes(res)) {return res;} 19 | else {memoria.push(res)} 20 | i++; 21 | } 22 | }; 23 | 24 | console.log(parte1()); 25 | console.log(parte2()); 26 | 27 | -------------------------------------------------------------------------------- /2018/day01/devcexx/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "2.11.12" 2 | 3 | // Set to false or remove if you want to show stubs as linking errors 4 | nativeLinkStubs := true 5 | nativeGC := "none" 6 | nativeMode := "release" 7 | 8 | enablePlugins(ScalaNativePlugin) 9 | -------------------------------------------------------------------------------- /2018/day01/devcexx/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version = 1.2.6 2 | -------------------------------------------------------------------------------- /2018/day01/devcexx/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8") 2 | -------------------------------------------------------------------------------- /2018/day01/devcexx/src/main/scala/Day01.scala: -------------------------------------------------------------------------------- 1 | import scala.annotation.tailrec 2 | import scala.collection.immutable.Stream.Empty 3 | import scala.io.StdIn 4 | 5 | object Day01 { 6 | def main(args: Array[String]): Unit = { 7 | def input(): Stream[String] = 8 | StdIn.readLine() match { 9 | case null => Empty //EOF 10 | case x => x #:: input() 11 | } 12 | def cycle(in: Stream[String]): Stream[String] = in #::: cycle(in) 13 | 14 | @tailrec 15 | def firstDup[A](lst: Stream[A], acc: Set[A] = Set[A]()): A = lst match { 16 | case hd #:: tl => if (acc.contains(hd)) hd else firstDup(tl, acc + hd) 17 | case _ => throw new Exception("No duplicate found") 18 | } 19 | 20 | println(firstDup(cycle(input()).scanLeft(0)(_ + _.toInt))) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /2018/day01/golot/killmepls.js: -------------------------------------------------------------------------------- 1 | //1 2 | eval(document.body.firstElementChild.textContent.split("\n").reduce((a, x) => a+x)) 3 | 4 | //2 5 | var f = new Set(); 6 | var r = NaN; 7 | var sum = 0; 8 | while(isNaN(r)) document.body.firstElementChild.textContent.split("\n").forEach(function(x) { n = parseInt(x); if(isNaN(n) || !isNaN(r)) return; sum+=n; if(f.has(sum)) r = sum; else f.add(sum); }) -------------------------------------------------------------------------------- /2018/day01/ignaciobll/calibration.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # Star 1 4 | print("Star 1:", sum(map(int, sys.stdin.readlines()))) 5 | -------------------------------------------------------------------------------- /2018/day01/ignaciobll/calibration2.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from itertools import cycle 3 | 4 | # Star 2 5 | 6 | visited = set([0]) 7 | freq = 0 8 | 9 | for n in cycle(map(int, sys.stdin.readlines())): 10 | freq += n 11 | if freq in visited: 12 | print ("Star2: ", freq) 13 | break 14 | visited.add(freq) 15 | -------------------------------------------------------------------------------- /2018/day01/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # Ironjanowar 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `ironjanowar` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:ironjanowar, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/ironjanowar](https://hexdocs.pm/ironjanowar). 21 | 22 | -------------------------------------------------------------------------------- /2018/day01/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Ironjanowar.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :ironjanowar, 7 | version: "0.1.0", 8 | elixir: "~> 1.7", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}, 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2018/day01/ironjanowar/src/parser.xrl: -------------------------------------------------------------------------------- 1 | Definitions. 2 | 3 | NUMS = [+|-][0-9]+ 4 | WHITESPACE = [\s\t\n\r] 5 | 6 | Rules. 7 | 8 | {WHITESPACE}+ : skip_token. 9 | {NUMS} : {token, list_to_integer(TokenChars)}. 10 | 11 | Erlang code. -------------------------------------------------------------------------------- /2018/day01/ironjanowar/test/ironjanowar_test.exs: -------------------------------------------------------------------------------- 1 | defmodule IronjanowarTest do 2 | use ExUnit.Case 3 | doctest Ironjanowar 4 | 5 | test "greets the world" do 6 | assert Ironjanowar.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2018/day01/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2018/day01/rubenaguadoc/main.js: -------------------------------------------------------------------------------- 1 | const input = require('fs').readFileSync('./input.txt').toString().trim().split(/\n/).map(e => parseInt(e)); 2 | 3 | // Part 1 4 | console.log(input.reduce((a, b) => a + b)); 5 | 6 | // Part 2 7 | let history = new Set(); 8 | let found = false; 9 | let acc = 0; 10 | 11 | while (!found) { 12 | found = input.some(e => { 13 | history.add(acc); 14 | acc += e; 15 | return history.has(acc); 16 | }); 17 | } 18 | 19 | console.log(acc); 20 | -------------------------------------------------------------------------------- /2018/day01/samgh96/day01/Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "day01" 3 | version = "0.1.0" 4 | 5 | -------------------------------------------------------------------------------- /2018/day01/samgh96/day01/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day01" 3 | version = "0.1.0" 4 | authors = ["Samuel García "] 5 | 6 | [dependencies] 7 | -------------------------------------------------------------------------------- /2018/day01/sami286/day1.kt: -------------------------------------------------------------------------------- 1 | import java.io.File 2 | 3 | fun main(args: Array) { 4 | println("part1: " + part1("2018/day01/sami286/input")) 5 | println("part2: " + part2("2018/day01/sami286/input")) 6 | } 7 | 8 | fun part1(input: String): Int = File(input) 9 | .readLines() 10 | .map { it.toInt() } 11 | .sum() 12 | 13 | fun part2(input: String): Int { 14 | var count = 0 15 | val seen = mutableSetOf(count) 16 | val numbers = File(input).readLines().map { it.toInt() } 17 | var i = 0 18 | while (true) { 19 | count += numbers[i] 20 | if (seen.contains(count)) return count 21 | seen.add(count) 22 | 23 | i++ 24 | if (i == numbers.size) 25 | i = 0 26 | } 27 | } -------------------------------------------------------------------------------- /2018/day01/skgsergio/calibration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | from itertools import accumulate, cycle 4 | 5 | 6 | def solve(i): 7 | c = [int(n.strip()) for n in i] 8 | 9 | part1 = sum(c) 10 | 11 | r = set([0]) 12 | part2 = next(n for n in accumulate(cycle(c)) if n in r or r.add(n)) 13 | 14 | return part1, part2 15 | 16 | 17 | if __name__ == '__main__': 18 | if len(sys.argv) < 2: 19 | print(f"Usage: {sys.argv[0]} ", file=sys.stderr) 20 | exit(1) 21 | 22 | i = None 23 | with open(sys.argv[1], 'r') as f: 24 | i = f.readlines() 25 | 26 | part1, part2 = solve(i) 27 | 28 | print(f"Part 1: {part1}") 29 | print(f"Part 2: {part2}") 30 | -------------------------------------------------------------------------------- /2018/day02/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # Ironjanowar 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `ironjanowar` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:ironjanowar, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/ironjanowar](https://hexdocs.pm/ironjanowar). 21 | 22 | -------------------------------------------------------------------------------- /2018/day02/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Ironjanowar.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :ironjanowar, 7 | version: "0.1.0", 8 | elixir: "~> 1.7", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}, 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2018/day02/ironjanowar/src/parser.xrl: -------------------------------------------------------------------------------- 1 | Definitions. 2 | 3 | IDS = [a-z]+ 4 | WHITESPACE = [\s\t\n\r] 5 | 6 | Rules. 7 | 8 | {WHITESPACE}+ : skip_token. 9 | {IDS} : {token, TokenChars}. 10 | 11 | Erlang code. -------------------------------------------------------------------------------- /2018/day02/ironjanowar/test/ironjanowar_test.exs: -------------------------------------------------------------------------------- 1 | defmodule IronjanowarTest do 2 | use ExUnit.Case 3 | doctest Ironjanowar 4 | 5 | test "greets the world" do 6 | assert Ironjanowar.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2018/day02/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2018/day02/skgsergio/ims.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | 5 | def solve(l): 6 | tw = 0 7 | th = 0 8 | 9 | for w in l: 10 | cs = set(w) 11 | tw += any(w.count(c) == 2 for c in cs) 12 | th += any(w.count(c) == 3 for c in cs) 13 | 14 | part1 = tw * th 15 | 16 | part2 = set(''.join([c1 for c1, c2 in zip(a, b) if c1 == c2]) for a in l[:-1] for b in l[1:] if sum([c1 != c2 for c1, c2 in zip(a, b)]) == 1) 17 | 18 | return part1, part2 19 | 20 | 21 | if __name__ == '__main__': 22 | if len(sys.argv) < 2: 23 | print(f"Usage: {sys.argv[0]} ", file=sys.stderr) 24 | exit(1) 25 | 26 | i = None 27 | with open(sys.argv[1], 'r') as f: 28 | i = f.read().splitlines() 29 | 30 | part1, part2 = solve(i) 31 | 32 | print(f"Part 1: {part1}") 33 | print(f"Part 2: {part2}") 34 | -------------------------------------------------------------------------------- /2018/day03/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # Ironjanowar 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `ironjanowar` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:ironjanowar, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/ironjanowar](https://hexdocs.pm/ironjanowar). 21 | 22 | -------------------------------------------------------------------------------- /2018/day03/ironjanowar/lib/solve1/agent.ex: -------------------------------------------------------------------------------- 1 | defmodule Solve1.Agent do 2 | use Agent 3 | 4 | def start_link() do 5 | Agent.start_link(fn -> Matrix.new(1000, 1000) end, name: __MODULE__) 6 | end 7 | 8 | def fill_matrix(id: id, position: {px, py}, size: {sx, sy}) do 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /2018/day03/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Ironjanowar.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :ironjanowar, 7 | version: "0.1.0", 8 | elixir: "~> 1.7", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | {:matrix, "~> 0.3.0"} 25 | ] 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /2018/day03/ironjanowar/mix.lock: -------------------------------------------------------------------------------- 1 | %{ 2 | "elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"}, 3 | "exprintf": {:hex, :exprintf, "0.2.1", "b7e895dfb00520cfb7fc1671303b63b37dc3897c59be7cbf1ae62f766a8a0314", [:mix], [], "hexpm"}, 4 | "matrex": {:hex, :matrex, "0.6.7", "cbbd65b58b333e456681c345e009b637b7d40cdb38b7fae3ceee407fa8e69321", [:make], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"}, 5 | "matrix": {:hex, :matrix, "0.3.2", "9c826bc3a1117bf5e1c5cdcf3a3d95456c93bc2e127a04e363e9fc90b724f784", [:mix], [{:exprintf, "~> 0.1", [hex: :exprintf, repo: "hexpm", optional: false]}], "hexpm"}, 6 | } 7 | -------------------------------------------------------------------------------- /2018/day03/ironjanowar/src/lex.xrl: -------------------------------------------------------------------------------- 1 | Definitions. 2 | 3 | WHITESPACE = [\s\t\n\r] 4 | IDS = #[0-9]+ 5 | SKIP = [@|\:] 6 | POSITION = [0-9]+,[0-9]+ 7 | SIZE = [0-9]+x[0-9]+ 8 | 9 | Rules. 10 | 11 | {WHITESPACE}+ : skip_token. 12 | {SKIP} : skip_token. 13 | {IDS} : {token, {id, TokenChars}}. 14 | {POSITION} : {token, {position, TokenChars}}. 15 | {SIZE} : {token, {size, TokenChars}}. 16 | 17 | Erlang code. -------------------------------------------------------------------------------- /2018/day03/ironjanowar/test/ironjanowar_test.exs: -------------------------------------------------------------------------------- 1 | defmodule IronjanowarTest do 2 | use ExUnit.Case 3 | doctest Ironjanowar 4 | 5 | test "greets the world" do 6 | assert Ironjanowar.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2018/day03/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2018/day03/rock/input_test: -------------------------------------------------------------------------------- 1 | #1 @ 1,3: 4x4 2 | #2 @ 3,1: 4x4 3 | #3 @ 5,5: 2x2 -------------------------------------------------------------------------------- /2018/day04/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # Ironjanowar 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `ironjanowar` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:ironjanowar, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/ironjanowar](https://hexdocs.pm/ironjanowar). 21 | 22 | -------------------------------------------------------------------------------- /2018/day04/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Ironjanowar.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :ironjanowar, 7 | version: "0.1.0", 8 | elixir: "~> 1.7", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | {:nimble_parsec, "0.4.0"} 25 | ] 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /2018/day04/ironjanowar/mix.lock: -------------------------------------------------------------------------------- 1 | %{ 2 | "nimble_parsec": {:hex, :nimble_parsec, "0.4.0", "ee261bb53214943679422be70f1658fff573c5d0b0a1ecd0f18738944f818efe", [:mix], [], "hexpm"}, 3 | } 4 | -------------------------------------------------------------------------------- /2018/day04/ironjanowar/test/ironjanowar_test.exs: -------------------------------------------------------------------------------- 1 | defmodule IronjanowarTest do 2 | use ExUnit.Case 3 | doctest Ironjanowar 4 | end 5 | -------------------------------------------------------------------------------- /2018/day04/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2018/day04/rock/input_test: -------------------------------------------------------------------------------- 1 | [1518-11-01 00:25] wakes up 2 | [1518-11-01 00:00] Guard #10 begins shift 3 | [1518-11-01 00:05] falls asleep 4 | [1518-11-01 00:30] falls asleep 5 | [1518-11-01 00:55] wakes up 6 | [1518-11-02 00:40] falls asleep 7 | [1518-11-02 00:50] wakes up 8 | [1518-11-03 00:05] Guard #10 begins shift 9 | [1518-11-03 00:24] falls asleep 10 | [1518-11-01 23:58] Guard #99 begins shift 11 | [1518-11-03 00:29] wakes up 12 | [1518-11-04 00:02] Guard #99 begins shift 13 | [1518-11-04 00:36] falls asleep 14 | [1518-11-04 00:46] wakes up 15 | [1518-11-05 00:03] Guard #99 begins shift 16 | [1518-11-05 00:45] falls asleep 17 | [1518-11-05 00:55] wakes up -------------------------------------------------------------------------------- /2018/day05/andsanmar.hs: -------------------------------------------------------------------------------- 1 | import Data.Char (toUpper) 2 | 3 | red :: String -> String 4 | red = foldr reaction "" 5 | where reaction x (y:ys) | react x y = ys 6 | reaction x ys = x:ys 7 | 8 | same :: Char -> Char -> Bool 9 | same x y = toUpper y == toUpper x 10 | 11 | react :: Char -> Char -> Bool 12 | react x y = same x y && y /= x 13 | 14 | star2 :: String -> Int 15 | star2 s = minimum $ map (\x -> length $ red $ del x s) ['a'..'z'] 16 | 17 | del :: Char -> String -> String 18 | del _ [] = [] 19 | del c (x:xs) 20 | | same c x = del c xs 21 | | otherwise = x:(del c xs) 22 | 23 | main :: IO() 24 | main = do 25 | text <- readFile "input" 26 | let reduced = red text 27 | putStrLn $ show $ length $ reduced 28 | putStrLn $ show $ star2 $ reduced 29 | -------------------------------------------------------------------------------- /2018/day05/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # Ironjanowar 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `ironjanowar` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:ironjanowar, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/ironjanowar](https://hexdocs.pm/ironjanowar). 21 | 22 | -------------------------------------------------------------------------------- /2018/day05/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Ironjanowar.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :ironjanowar, 7 | version: "0.1.0", 8 | elixir: "~> 1.7", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}, 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2018/day05/ironjanowar/test/ironjanowar_test.exs: -------------------------------------------------------------------------------- 1 | defmodule IronjanowarTest do 2 | use ExUnit.Case 3 | doctest Ironjanowar 4 | end 5 | -------------------------------------------------------------------------------- /2018/day05/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2018/day05/ironjanowar/test_input: -------------------------------------------------------------------------------- 1 | dabAcCaCBAcCcaDA -------------------------------------------------------------------------------- /2018/day05/rock/input_test: -------------------------------------------------------------------------------- 1 | dabAcCaCBAcCcaDA -------------------------------------------------------------------------------- /2018/day05/skgsergio/reduction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | 5 | def react(chain): 6 | poly = [] 7 | 8 | for unit in chain: 9 | if poly and abs(ord(unit) - ord(poly[-1])) == 32: 10 | poly.pop() 11 | else: 12 | poly.append(unit) 13 | 14 | return poly 15 | 16 | 17 | def solve(c): 18 | part1 = len(react(c)) 19 | 20 | part2 = min([len(react(c.replace(u, '').replace(u.upper(), ''))) for u in set(c.lower())]) 21 | 22 | return part1, part2 23 | 24 | 25 | if __name__ == '__main__': 26 | if len(sys.argv) < 2: 27 | print(f"Usage: {sys.argv[0]} ", file=sys.stderr) 28 | exit(1) 29 | 30 | d = None 31 | with open(sys.argv[1], 'r') as f: 32 | d = f.read().strip() 33 | 34 | part1, part2 = solve(d) 35 | 36 | print(f"Part 1: {part1}") 37 | print(f"Part 2: {part2}") 38 | -------------------------------------------------------------------------------- /2018/day06/andsanmar.input: -------------------------------------------------------------------------------- 1 | 194, 200 2 | 299, 244 3 | 269, 329 4 | 292, 55 5 | 211, 63 6 | 123, 311 7 | 212, 90 8 | 292, 169 9 | 359, 177 10 | 354, 95 11 | 101, 47 12 | 95, 79 13 | 95, 287 14 | 294, 126 15 | 81, 267 16 | 330, 78 17 | 202, 165 18 | 225, 178 19 | 266, 272 20 | 351, 326 21 | 180, 62 22 | 102, 178 23 | 151, 101 24 | 343, 145 25 | 205, 312 26 | 74, 193 27 | 221, 56 28 | 89, 89 29 | 242, 172 30 | 59, 138 31 | 83, 179 32 | 223, 88 33 | 297, 234 34 | 147, 351 35 | 226, 320 36 | 358, 338 37 | 321, 172 38 | 54, 122 39 | 263, 165 40 | 126, 341 41 | 64, 132 42 | 264, 306 43 | 72, 202 44 | 98, 49 45 | 238, 67 46 | 310, 303 47 | 277, 281 48 | 222, 318 49 | 357, 169 50 | 123, 225 51 | -------------------------------------------------------------------------------- /2018/day06/rock/input: -------------------------------------------------------------------------------- 1 | 81, 252 2 | 67, 186 3 | 206, 89 4 | 97, 126 5 | 251, 337 6 | 93, 101 7 | 193, 113 8 | 101, 249 9 | 276, 304 10 | 127, 140 11 | 289, 189 12 | 289, 264 13 | 79, 66 14 | 178, 248 15 | 91, 231 16 | 75, 157 17 | 260, 221 18 | 327, 312 19 | 312, 141 20 | 112, 235 21 | 97, 354 22 | 50, 200 23 | 192, 303 24 | 108, 127 25 | 281, 359 26 | 128, 209 27 | 50, 306 28 | 67, 314 29 | 358, 270 30 | 87, 122 31 | 311, 83 32 | 166, 192 33 | 170, 307 34 | 322, 320 35 | 352, 265 36 | 167, 342 37 | 296, 145 38 | 231, 263 39 | 340, 344 40 | 134, 132 41 | 72, 281 42 | 135, 352 43 | 140, 119 44 | 58, 325 45 | 247, 123 46 | 256, 346 47 | 330, 356 48 | 281, 177 49 | 216, 145 50 | 278, 98 -------------------------------------------------------------------------------- /2018/day06/rock/input_test: -------------------------------------------------------------------------------- 1 | 1, 1 2 | 1, 6 3 | 8, 3 4 | 3, 4 5 | 5, 5 6 | 8, 9 -------------------------------------------------------------------------------- /2018/day06/rubenaguadoc/input.txt: -------------------------------------------------------------------------------- 1 | 152, 292 2 | 163, 90 3 | 258, 65 4 | 123, 147 5 | 342, 42 6 | 325, 185 7 | 69, 45 8 | 249, 336 9 | 92, 134 10 | 230, 241 11 | 74, 262 12 | 241, 78 13 | 299, 58 14 | 231, 146 15 | 239, 87 16 | 44, 157 17 | 156, 340 18 | 227, 226 19 | 212, 318 20 | 194, 135 21 | 235, 146 22 | 171, 197 23 | 160, 59 24 | 218, 205 25 | 323, 102 26 | 290, 356 27 | 244, 214 28 | 174, 250 29 | 70, 331 30 | 288, 80 31 | 268, 128 32 | 359, 98 33 | 78, 249 34 | 221, 48 35 | 321, 228 36 | 52, 225 37 | 151, 302 38 | 183, 150 39 | 142, 327 40 | 172, 56 41 | 72, 321 42 | 225, 298 43 | 265, 300 44 | 86, 288 45 | 78, 120 46 | 146, 345 47 | 268, 181 48 | 243, 235 49 | 262, 268 50 | 40, 60 51 | -------------------------------------------------------------------------------- /2018/day06/sami286/input: -------------------------------------------------------------------------------- 1 | 336, 308 2 | 262, 98 3 | 352, 115 4 | 225, 205 5 | 292, 185 6 | 166, 271 7 | 251, 67 8 | 266, 274 9 | 326, 85 10 | 191, 256 11 | 62, 171 12 | 333, 123 13 | 160, 131 14 | 211, 214 15 | 287, 333 16 | 231, 288 17 | 237, 183 18 | 211, 272 19 | 116, 153 20 | 336, 70 21 | 291, 117 22 | 156, 105 23 | 261, 119 24 | 216, 171 25 | 59, 343 26 | 50, 180 27 | 251, 268 28 | 169, 258 29 | 75, 136 30 | 305, 102 31 | 154, 327 32 | 187, 297 33 | 270, 225 34 | 190, 185 35 | 339, 264 36 | 103, 301 37 | 90, 92 38 | 164, 144 39 | 108, 140 40 | 189, 211 41 | 125, 157 42 | 77, 226 43 | 177, 168 44 | 46, 188 45 | 216, 244 46 | 346, 348 47 | 272, 90 48 | 140, 176 49 | 109, 324 50 | 128, 132 51 | -------------------------------------------------------------------------------- /2018/day06/skgsergio/input: -------------------------------------------------------------------------------- 1 | 311, 74 2 | 240, 84 3 | 54, 241 4 | 99, 336 5 | 53, 244 6 | 269, 353 7 | 175, 75 8 | 119, 271 9 | 267, 301 10 | 251, 248 11 | 216, 259 12 | 327, 50 13 | 120, 248 14 | 56, 162 15 | 42, 278 16 | 309, 269 17 | 176, 74 18 | 305, 86 19 | 93, 359 20 | 311, 189 21 | 85, 111 22 | 255, 106 23 | 286, 108 24 | 233, 228 25 | 105, 211 26 | 66, 256 27 | 213, 291 28 | 67, 53 29 | 308, 190 30 | 320, 131 31 | 254, 179 32 | 338, 44 33 | 88, 70 34 | 296, 113 35 | 278, 75 36 | 92, 316 37 | 274, 92 38 | 147, 121 39 | 71, 181 40 | 113, 268 41 | 317, 53 42 | 188, 180 43 | 42, 267 44 | 251, 98 45 | 278, 85 46 | 268, 266 47 | 334, 337 48 | 74, 69 49 | 102, 227 50 | 194, 239 51 | -------------------------------------------------------------------------------- /2018/day07/rock/input_test: -------------------------------------------------------------------------------- 1 | Step C must be finished before step A can begin. 2 | Step C must be finished before step F can begin. 3 | Step A must be finished before step B can begin. 4 | Step A must be finished before step D can begin. 5 | Step B must be finished before step E can begin. 6 | Step D must be finished before step E can begin. 7 | Step F must be finished before step E can begin. -------------------------------------------------------------------------------- /2018/day08/andsanmar.hs: -------------------------------------------------------------------------------- 1 | import Data.Tree 2 | 3 | star1 :: [Int] -> (Int,[Int]) 4 | star1 (0:m:s) = (sum $ take m s, drop m s) 5 | star1 (n:m:s) = (\(a,b) -> (a+(sum $ take m b), drop m b)) $ foldl (\(l,r) _ -> (l + (fst $ star1 r), snd $ star1 r)) (0,s) [1..n] 6 | 7 | star2 :: [Int] -> (Int,[Int]) 8 | star2 (0:m:s) = (sum $ take m s, drop m s) 9 | star2 (n:m:s) = (\(a,b) -> (foldl (\l y -> (l + if y > n then 0 else a !! (y-1))) 0 (take m b), (drop m b))) $ foldl (\(l,r) _ -> (l ++ [fst $ star2 r], snd $ star2 r)) ([],s) [1..n] 10 | 11 | main :: IO() 12 | main = do 13 | text <- readFile "input" 14 | let dat = map read $ words text :: [Int] 15 | putStrLn $ show $ star1 dat 16 | putStrLn $ show $ star2 dat 17 | -------------------------------------------------------------------------------- /2018/day08/rock/input_test: -------------------------------------------------------------------------------- 1 | 2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2 -------------------------------------------------------------------------------- /2018/day08/rubenaguadoc/main.js: -------------------------------------------------------------------------------- 1 | const input = require('fs').readFileSync('./input.txt').toString().trim().split(/\s/).map(e => parseInt(e)); 2 | 3 | // 1 + 2 4 | function sumNode(chain, index) { 5 | const [ nChilds, nMetadata ] = [ chain[index.i++], chain[index.i++] ]; 6 | let [ sum1, sum2, childrenValues ] = [ 0, 0, [] ]; 7 | for (let i = 0; i < nChilds; i++) { 8 | const [ s1, s2 ] = sumNode(chain, index); 9 | sum1 += s1; 10 | childrenValues.push(s2); 11 | } 12 | for (let i = 0; i < nMetadata; i++) { 13 | const val = chain[index.i++]; 14 | sum1 += val; 15 | sum2 += nChilds == 0 ? val : (childrenValues[val - 1] || 0); 16 | } 17 | return [ sum1, sum2 ]; 18 | } 19 | 20 | sumNode(input, { i: 0 }).forEach(e => console.log(e)); 21 | -------------------------------------------------------------------------------- /2018/day09/rock/input: -------------------------------------------------------------------------------- 1 | 477 players; last marble is worth 70851 points -------------------------------------------------------------------------------- /2018/day09/rock/input_test: -------------------------------------------------------------------------------- 1 | 10 players; last marble is worth 1618 points 2 | 13 players; last marble is worth 7999 points 3 | 17 players; last marble is worth 1104 points 4 | 21 players; last marble is worth 6111 points 5 | 30 players; last marble is worth 5807 points -------------------------------------------------------------------------------- /2018/day09/rubenaguadoc/star2.js: -------------------------------------------------------------------------------- 1 | const { Element, LinkedList } = require('./LinkedList'); 2 | // 413 players; last marble is worth 71082 points 3 | const players = 413; 4 | const lastMarble = 71082 * 100; 5 | 6 | 7 | let score = {}; 8 | console.time('LinkedList'); 9 | circle = new LinkedList(new Element(0)); 10 | 11 | for (let i = 1; i <= lastMarble; i++) { 12 | if (i % 23 != 0) { 13 | circle.rol(); 14 | circle.push(new Element(i)); 15 | } else { 16 | let currentPlayer = ((i - 1) % players) + 1; 17 | circle.ror(7); 18 | score[currentPlayer] = (score[currentPlayer] || 0) + i + circle.pop().value(); 19 | circle.rol(); 20 | } 21 | } 22 | 23 | console.log( 24 | Object.values(score).reduce((a, b) => a > b ? a : b) 25 | ); 26 | console.timeEnd('LinkedList'); 27 | -------------------------------------------------------------------------------- /2018/day09/skgsergio/input: -------------------------------------------------------------------------------- 1 | 455 players; last marble is worth 71223 points 2 | -------------------------------------------------------------------------------- /2018/day10/rubenaguadoc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Sky 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /2018/day11/rock/input: -------------------------------------------------------------------------------- 1 | 9810 -------------------------------------------------------------------------------- /2018/day11/rock/input_test: -------------------------------------------------------------------------------- 1 | 42 -------------------------------------------------------------------------------- /2018/day11/rubenaguadoc/main.js: -------------------------------------------------------------------------------- 1 | const inpt = 1308; 2 | 3 | const cell = (x, y, serial=inpt) => Math.floor(((x + 10) * y + serial) * (x + 10) % 1000 / 100) - 5; 4 | 5 | function gridVal (x, y, s=3) { 6 | let sum = 0; 7 | for (let dx = 0; dx < s; dx++) { 8 | for (let dy = 0; dy < s; dy++) { 9 | sum += cell(x + dx, y + dy); 10 | } 11 | } 12 | return sum; 13 | } 14 | 15 | console.time('Time BF'); 16 | let [n, max, mx, my, ms] = [0, 0, 0, 0, 0]; 17 | for (let s = 1; s <= 300; s++) { 18 | for (let x = 1; x <= 300 - s + 1; x++) { 19 | for (let y = 1; y <= 300 - s + 1; y++) { 20 | n = gridVal(x, y, s); 21 | if (n > max) { 22 | [max, mx, my, ms] = [n, x, y, s]; 23 | } 24 | } 25 | } 26 | } 27 | console.timeEnd('Time BF'); 28 | 29 | console.log(`${mx},${my},${ms}`); 30 | -------------------------------------------------------------------------------- /2018/day12/rock/input: -------------------------------------------------------------------------------- 1 | initial state: ##.#....#..#......#..######..#.####.....#......##.##.##...#..#....#.#.##..##.##.#.#..#.#....#.#..#.# 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 | ##.## => # 27 | ##.#. => # 28 | #.##. => # 29 | .##.. => . 30 | ..#.# => . 31 | ....# => . 32 | ###.# => . 33 | ..... => . 34 | .#### => . -------------------------------------------------------------------------------- /2018/day12/rock/input_test: -------------------------------------------------------------------------------- 1 | initial state: #..#.#..##......###...### 2 | 3 | ...## => # 4 | ..#.. => # 5 | .#... => # 6 | .#.#. => # 7 | .#.## => # 8 | .##.. => # 9 | .#### => # 10 | #.#.# => # 11 | #.### => # 12 | ##.#. => # 13 | ##.## => # 14 | ###.. => # 15 | ###.# => # 16 | ####. => # -------------------------------------------------------------------------------- /2018/day12/rubenaguadoc/input.txt: -------------------------------------------------------------------------------- 1 | initial state: ##.###.......#..#.##..#####...#...#######....##.##.##.##..#.#.##########...##.##..##.##...####..#### 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 | ..##. => . 27 | ##.#. => . 28 | ...## => # 29 | ...#. => . 30 | ..... => . 31 | ##.## => . 32 | ###.# => # 33 | ##### => # 34 | #.### => . 35 | -------------------------------------------------------------------------------- /2018/day12/rubenaguadoc/testInput.txt: -------------------------------------------------------------------------------- 1 | initial state: #..#.#..##......###...### 2 | 3 | ...## => # 4 | ..#.. => # 5 | .#... => # 6 | .#.#. => # 7 | .#.## => # 8 | .##.. => # 9 | .#### => # 10 | #.#.# => # 11 | #.### => # 12 | ##.#. => # 13 | ##.## => # 14 | ###.. => # 15 | ###.# => # 16 | ####. => # 17 | -------------------------------------------------------------------------------- /2018/day12/skgsergio/input: -------------------------------------------------------------------------------- 1 | initial state: #....##.#.#.####..#.######..##.#.########..#...##...##...##.#.#...######.###....#...##..#.#....##.## 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 | #.### => . 27 | #...# => # 28 | ###.# => # 29 | ...#. => # 30 | .###. => . 31 | .#..# => # 32 | ..... => . 33 | #.... => . 34 | #.##. => # 35 | -------------------------------------------------------------------------------- /2018/day13/rock/input_test: -------------------------------------------------------------------------------- 1 | /->-\ 2 | | | /----\ 3 | | /-+--+-\ | 4 | | | | | v | 5 | \-+-/ \-+--/ 6 | \------/ -------------------------------------------------------------------------------- /2018/day14/rubenaguadoc/main.js: -------------------------------------------------------------------------------- 1 | const input = 760221; 2 | // const input = 59414; 3 | 4 | let recipes = [3, 7]; 5 | let elf1 = 0; 6 | let elf2 = 1; 7 | let i = 0; 8 | let response = ''; 9 | 10 | while (true) { 11 | let newRecipes = (recipes[elf1] + recipes[elf2]).toString().split(''); 12 | newRecipes.forEach(recipe => recipes.push(parseInt(recipe))); 13 | elf1 = (elf1 + recipes[elf1] + 1) % recipes.length; 14 | elf2 = (elf2 + recipes[elf2] + 1) % recipes.length; 15 | 16 | if (i >= input && i <= input + 10) { 17 | response += recipes[i]; 18 | if (response.length == 10) console.log(`1: ${response}`); 19 | } 20 | 21 | if (i % 10000000 == 0) { 22 | let match = new RegExp(input.toString()).exec(recipes.join('')); 23 | if (match) { 24 | console.log(`2: ${match.index}`); 25 | break; 26 | } 27 | } 28 | i++; 29 | } 30 | -------------------------------------------------------------------------------- /2018/day15/rock/input_test: -------------------------------------------------------------------------------- 1 | ####### 2 | #G..#E# 3 | #E#E.E# 4 | #G.##.# 5 | #...#E# 6 | #...E.# 7 | ####### -------------------------------------------------------------------------------- /2018/day15/rock/input_test2: -------------------------------------------------------------------------------- 1 | ####### 2 | #.G...# 3 | #...EG# 4 | #.#.#G# 5 | #..G#E# 6 | #.....# 7 | ####### -------------------------------------------------------------------------------- /2018/day16/rock/input_test: -------------------------------------------------------------------------------- 1 | Before: [3, 2, 1, 1] 2 | 9 2 1 2 3 | After: [3, 2, 2, 1] -------------------------------------------------------------------------------- /2018/day17/rock/input_test: -------------------------------------------------------------------------------- 1 | x=495, y=2..7 2 | y=7, x=495..501 3 | x=501, y=3..7 4 | x=498, y=2..4 5 | x=506, y=1..2 6 | x=498, y=10..13 7 | x=504, y=10..13 8 | y=13, x=498..504 -------------------------------------------------------------------------------- /2018/day18/rock/input_test: -------------------------------------------------------------------------------- 1 | .#.#...|#. 2 | .....#|##| 3 | .|..|...#. 4 | ..|#.....# 5 | #.#|||#|#| 6 | ...#.||... 7 | .|....|... 8 | ||...#|.#| 9 | |.||||..|. 10 | ...#.|..|. -------------------------------------------------------------------------------- /2018/day19/rock/input: -------------------------------------------------------------------------------- 1 | #ip 4 2 | addi 4 16 4 3 | seti 1 4 3 4 | seti 1 3 5 5 | mulr 3 5 1 6 | eqrr 1 2 1 7 | addr 1 4 4 8 | addi 4 1 4 9 | addr 3 0 0 10 | addi 5 1 5 11 | gtrr 5 2 1 12 | addr 4 1 4 13 | seti 2 9 4 14 | addi 3 1 3 15 | gtrr 3 2 1 16 | addr 1 4 4 17 | seti 1 6 4 18 | mulr 4 4 4 19 | addi 2 2 2 20 | mulr 2 2 2 21 | mulr 4 2 2 22 | muli 2 11 2 23 | addi 1 2 1 24 | mulr 1 4 1 25 | addi 1 7 1 26 | addr 2 1 2 27 | addr 4 0 4 28 | seti 0 8 4 29 | setr 4 3 1 30 | mulr 1 4 1 31 | addr 4 1 1 32 | mulr 4 1 1 33 | muli 1 14 1 34 | mulr 1 4 1 35 | addr 2 1 2 36 | seti 0 3 0 37 | seti 0 6 4 -------------------------------------------------------------------------------- /2018/day19/rock/input_test: -------------------------------------------------------------------------------- 1 | #ip 0 2 | seti 5 0 1 3 | seti 6 0 2 4 | addi 0 1 0 5 | addr 1 2 3 6 | setr 1 0 0 7 | seti 8 0 4 8 | seti 9 0 5 -------------------------------------------------------------------------------- /2018/day19/skgsergio/input: -------------------------------------------------------------------------------- 1 | #ip 3 2 | addi 3 16 3 3 | seti 1 2 5 4 | seti 1 3 2 5 | mulr 5 2 1 6 | eqrr 1 4 1 7 | addr 1 3 3 8 | addi 3 1 3 9 | addr 5 0 0 10 | addi 2 1 2 11 | gtrr 2 4 1 12 | addr 3 1 3 13 | seti 2 5 3 14 | addi 5 1 5 15 | gtrr 5 4 1 16 | addr 1 3 3 17 | seti 1 2 3 18 | mulr 3 3 3 19 | addi 4 2 4 20 | mulr 4 4 4 21 | mulr 3 4 4 22 | muli 4 11 4 23 | addi 1 6 1 24 | mulr 1 3 1 25 | addi 1 21 1 26 | addr 4 1 4 27 | addr 3 0 3 28 | seti 0 3 3 29 | setr 3 4 1 30 | mulr 1 3 1 31 | addr 3 1 1 32 | mulr 3 1 1 33 | muli 1 14 1 34 | mulr 1 3 1 35 | addr 4 1 4 36 | seti 0 3 0 37 | seti 0 7 3 38 | -------------------------------------------------------------------------------- /2018/day20/rock/input_test: -------------------------------------------------------------------------------- 1 | ^ESSWWN(E|NNENN(EESS(WNSE|)SSS|WWWSSSSE(SW|NNNE)))$ -------------------------------------------------------------------------------- /2018/day21/rock/input: -------------------------------------------------------------------------------- 1 | #ip 4 2 | seti 123 0 1 3 | bani 1 456 1 4 | eqri 1 72 1 5 | addr 1 4 4 6 | seti 0 0 4 7 | seti 0 3 1 8 | bori 1 65536 2 9 | seti 7902108 7 1 10 | bani 2 255 5 11 | addr 1 5 1 12 | bani 1 16777215 1 13 | muli 1 65899 1 14 | bani 1 16777215 1 15 | gtir 256 2 5 16 | addr 5 4 4 17 | addi 4 1 4 18 | seti 27 0 4 19 | seti 0 0 5 20 | addi 5 1 3 21 | muli 3 256 3 22 | gtrr 3 2 3 23 | addr 3 4 4 24 | addi 4 1 4 25 | seti 25 2 4 26 | addi 5 1 5 27 | seti 17 2 4 28 | setr 5 1 2 29 | seti 7 2 4 30 | eqrr 1 0 5 31 | addr 5 4 4 32 | seti 5 9 4 -------------------------------------------------------------------------------- /2018/day21/skgsergio/input: -------------------------------------------------------------------------------- 1 | #ip 1 2 | seti 123 0 5 3 | bani 5 456 5 4 | eqri 5 72 5 5 | addr 5 1 1 6 | seti 0 0 1 7 | seti 0 9 5 8 | bori 5 65536 2 9 | seti 7571367 9 5 10 | bani 2 255 4 11 | addr 5 4 5 12 | bani 5 16777215 5 13 | muli 5 65899 5 14 | bani 5 16777215 5 15 | gtir 256 2 4 16 | addr 4 1 1 17 | addi 1 1 1 18 | seti 27 1 1 19 | seti 0 2 4 20 | addi 4 1 3 21 | muli 3 256 3 22 | gtrr 3 2 3 23 | addr 3 1 1 24 | addi 1 1 1 25 | seti 25 6 1 26 | addi 4 1 4 27 | seti 17 8 1 28 | setr 4 6 2 29 | seti 7 4 1 30 | eqrr 5 0 4 31 | addr 4 1 1 32 | seti 5 5 1 33 | -------------------------------------------------------------------------------- /2018/day22/skgsergio/input: -------------------------------------------------------------------------------- 1 | depth: 10914 2 | target: 9,739 3 | -------------------------------------------------------------------------------- /2018/day23/rock/input_test: -------------------------------------------------------------------------------- 1 | pos=<10,12,12>, r=2 2 | pos=<12,14,12>, r=2 3 | pos=<16,12,12>, r=4 4 | pos=<14,14,14>, r=6 5 | pos=<50,50,50>, r=200 6 | pos=<10,10,10>, r=5 -------------------------------------------------------------------------------- /2018/day24/rock/input_test: -------------------------------------------------------------------------------- 1 | Immune System: 2 | 17 units each with 5390 hit points (weak to radiation, bludgeoning) with an attack that does 4507 fire damage at initiative 2 3 | 989 units each with 1274 hit points (immune to fire; weak to bludgeoning, slashing) with an attack that does 25 slashing damage at initiative 3 4 | 5 | Infection: 6 | 801 units each with 4706 hit points (weak to radiation) with an attack that does 116 bludgeoning damage at initiative 1 7 | 4485 units each with 2961 hit points (immune to radiation; weak to fire, cold) with an attack that does 12 slashing damage at initiative 4 8 | -------------------------------------------------------------------------------- /2018/day25/rock/input_test: -------------------------------------------------------------------------------- 1 | 1,-1,0,1 2 | 2,0,-1,0 3 | 3,2,-1,0 4 | 0,0,3,1 5 | 0,0,-1,-1 6 | 2,3,-2,0 7 | -2,2,0,0 8 | 2,-2,0,-1 9 | 1,-1,0,-1 10 | 3,2,0,2 -------------------------------------------------------------------------------- /2019/day01/andsanmar/main.hs: -------------------------------------------------------------------------------- 1 | import System.Environment 2 | 3 | transf :: Integer -> Integer 4 | transf x = div x 3 - 2 5 | 6 | requireFuel :: Integer -> [Integer] 7 | requireFuel x = if x <= 0 || newfuel <= 0 then [0] else newfuel:requireFuel newfuel 8 | where newfuel = transf x 9 | 10 | main :: IO () 11 | main = do 12 | (f:_) <- getArgs 13 | s <- readFile f 14 | let result = map (transf . read) (lines s) 15 | -- putStrLn $ show (result) 16 | print (sum result) 17 | let result2 = map requireFuel result 18 | -- putStrLn $ show result2 19 | print (sum result + sum (map sum result2)) 20 | -------------------------------------------------------------------------------- /2019/day01/foldr/one.ml: -------------------------------------------------------------------------------- 1 | 2 | let read_next () = try 3 | let n = read_int () in Some n 4 | with End_of_file -> None 5 | ;; 6 | 7 | let convert mass = mass / 3 - 2;; 8 | 9 | let rec one x = 10 | match read_next () with 11 | | Some n -> one (x + (convert n)) 12 | | None -> x 13 | ;; 14 | 15 | let () = one 0 |> string_of_int |> print_endline 16 | -------------------------------------------------------------------------------- /2019/day01/foldr/two.ml: -------------------------------------------------------------------------------- 1 | 2 | let read_next () = try 3 | let n = read_int () in Some n 4 | with End_of_file -> None 5 | ;; 6 | 7 | let convert mass = mass / 3 - 2;; 8 | 9 | let rec two x = 10 | let fuel = convert x in 11 | if fuel <= 0 12 | then x 13 | else x + two fuel 14 | 15 | let rec one acc = 16 | match read_next () with 17 | | Some mass -> let fuel = convert mass |> two in 18 | one (acc + fuel) 19 | | None -> acc 20 | ;; 21 | 22 | 23 | let () = one 0 |> string_of_int |> print_endline 24 | -------------------------------------------------------------------------------- /2019/day01/golot/day1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int fuelrec(int mass) { 6 | int fuel = mass / 3 - 2; 7 | return fuel > 0 ? fuel + fuelrec(fuel) : 0; 8 | } 9 | 10 | int main() { 11 | int sum = 0; 12 | int sum2 = 0; 13 | int sum3 = 0; 14 | std::ifstream inputfile("input.txt"); 15 | std::string line; 16 | while (std::getline(inputfile, line)) { 17 | int fuel = std::stoi(line) / 3 - 2; 18 | sum += fuel; 19 | sum2 += fuel + fuelrec(fuel); 20 | sum3 += fuel; 21 | while(fuel > 0) { 22 | fuel = fuel / 3 - 2; 23 | if(fuel > 0) 24 | sum3 += fuel; 25 | } 26 | } 27 | 28 | std::cout << "Fuel 1: " << sum << std::endl; 29 | std::cout << "Fuel 2 (rec): " << sum2 << std::endl; 30 | std::cout << "Fuel 2 (non-rec): " << sum3 << std::endl; 31 | 32 | return 0; 33 | } -------------------------------------------------------------------------------- /2019/day01/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # AdventCode 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `advent_code` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:advent_code, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/advent_code](https://hexdocs.pm/advent_code). 21 | 22 | -------------------------------------------------------------------------------- /2019/day01/ironjanowar/lib/advent_code.ex: -------------------------------------------------------------------------------- 1 | defmodule AdventCode do 2 | def get_input() do 3 | File.stream!("input") 4 | end 5 | 6 | def day_1() do 7 | get_input() 8 | |> Stream.map(&operate/1) 9 | |> Enum.reduce(0, fn x, acc -> x + acc end) 10 | end 11 | 12 | def operate(number) do 13 | fuel = number |> Integer.parse() |> elem(0) |> Integer.floor_div(3) 14 | fuel - 2 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /2019/day01/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule AdventCode.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :advent_code, 7 | version: "0.1.0", 8 | elixir: "~> 1.9", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2019/day01/ironjanowar/test/advent_code_test.exs: -------------------------------------------------------------------------------- 1 | defmodule AdventCodeTest do 2 | use ExUnit.Case 3 | doctest AdventCode 4 | 5 | test "greets the world" do 6 | assert AdventCode.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2019/day01/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2019/day01/jasviers/main.py: -------------------------------------------------------------------------------- 1 | data1 = open('imput1.txt', 'r').readlines() 2 | 3 | def fuel(data, fun): 4 | return sum(map(fun, data)) 5 | 6 | def _rec(a): 7 | return _rec(x) + x if (x:=int(a)//3-2)>0 else 0 8 | 9 | print(f'Solution 1: {fuel(data1, lambda a : int(a)//3-2)}') 10 | print(f'Solution 2: {fuel(data1, _rec)}') 11 | -------------------------------------------------------------------------------- /2019/day01/justantors/puzzle1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | def calculatePart2(list): 5 | result = 0 6 | for mod in list: 7 | while((mod := int(mod/3)-2) > 0): 8 | result += mod 9 | return result 10 | 11 | if(len(sys.argv) != 2): 12 | print('python3 puzzle1.py ') 13 | exit(1) 14 | 15 | input = open(sys.argv[1], 'r') # Open file 16 | input_formatted = list(map(lambda str : int(str), input.readlines())) # Cast every element (str) to an int 17 | result1 = list(map(lambda num: int(num/3) - 2, input_formatted)) 18 | result2 = calculatePart2(input_formatted) 19 | print('Puzzle 1: {}'.format(sum(result1))) 20 | print('Puzzle 2: {}'.format(result2)) 21 | -------------------------------------------------------------------------------- /2019/day01/owayss/fuel.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "log" 7 | "os" 8 | "strconv" 9 | ) 10 | 11 | func neededFuel(mass uint64) uint64 { 12 | // equation is: (mass / 3) - 2 13 | ans := (mass / 3) 14 | if ans >= 2 { 15 | return ans - 2 16 | } 17 | // negative fuel is zero fuel 18 | return 0 19 | } 20 | 21 | func main() { 22 | file, err := os.Open("input") 23 | if err != nil { 24 | log.Fatal(err) 25 | } 26 | defer file.Close() 27 | 28 | var totalFuel uint64 29 | scanner := bufio.NewScanner(file) 30 | for scanner.Scan() { 31 | mass, err := strconv.ParseUint(scanner.Text(), 10, 64) 32 | if err != nil { 33 | log.Fatalf("could not parse line: %v", err) 34 | } 35 | fuel := neededFuel(mass) 36 | for fuel > 0 { 37 | totalFuel += fuel 38 | fuel = neededFuel(fuel) 39 | } 40 | } 41 | fmt.Println(totalFuel) 42 | } 43 | -------------------------------------------------------------------------------- /2019/day01/owayss/fuel_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestNeededFuel(t *testing.T) { 9 | var tests = []struct { 10 | input uint64 11 | want uint64 12 | }{ 13 | {12, 2}, 14 | {14, 2}, 15 | {1969, 654}, 16 | {100756, 33583}, 17 | } 18 | 19 | for _, tt := range tests { 20 | testname := fmt.Sprintf("mass: %d", tt.input) 21 | t.Run(testname, func(t *testing.T) { 22 | ans := neededFuel(tt.input) 23 | if ans != tt.want { 24 | t.Errorf("got %d, want %d", ans, tt.want) 25 | } 26 | }) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2019/day01/samgh96/day1.nim: -------------------------------------------------------------------------------- 1 | import parseutils 2 | 3 | let file = "input.txt" 4 | let part = 2 5 | 6 | proc calc_fuel(n: int): int = 7 | return int(n / 3) - 2 8 | 9 | proc calc_all_fuels(n: int): int = 10 | var rec_n = calc_fuel(n) 11 | var carry = 0 12 | while rec_n > 0: 13 | carry += rec_n 14 | rec_n = calc_fuel(rec_n) 15 | return carry 16 | 17 | proc get_answer(filename: string): int = 18 | let input = open(filename) 19 | var acc = 0 20 | 21 | for line in input.lines: 22 | var parsedInt = 0 23 | discard parseInt(line, parsedInt) 24 | if part == 1: 25 | acc += calc_fuel(parsedInt) 26 | elif part == 2: 27 | acc += calc_all_fuels(parsedInt) 28 | return acc 29 | 30 | echo get_answer(file) 31 | -------------------------------------------------------------------------------- /2019/day01/skgsergio/mass.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from typing import List 4 | 5 | 6 | def module_fuel(mass: int) -> int: 7 | return (mass // 3) - 2 8 | 9 | 10 | def required_fuel(masses: List[int]) -> int: 11 | return sum(module_fuel(m) for m in masses) 12 | 13 | 14 | def total_fuel(masses: List[int]) -> int: 15 | total = 0 16 | 17 | for m in masses: 18 | while (m := module_fuel(m)) > 0: 19 | total += m 20 | 21 | return total 22 | 23 | 24 | if __name__ == '__main__': 25 | if len(sys.argv) < 2: 26 | print(f"Usage: {sys.argv[0]} ", file=sys.stderr) 27 | exit(1) 28 | 29 | with open(sys.argv[1], 'r') as f: 30 | d = f.readlines() 31 | 32 | d = list(map(int, d)) 33 | 34 | print(f'Part 1: {required_fuel(d)}') 35 | print(f'Part 2: {total_fuel(d)}') 36 | -------------------------------------------------------------------------------- /2019/day02/owayss/input: -------------------------------------------------------------------------------- 1 | 1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,1,10,19,2,6,19,23,1,23,5,27,1,27,13,31,2,6,31,35,1,5,35,39,1,39,10,43,2,6,43,47,1,47,5,51,1,51,9,55,2,55,6,59,1,59,10,63,2,63,9,67,1,67,5,71,1,71,5,75,2,75,6,79,1,5,79,83,1,10,83,87,2,13,87,91,1,10,91,95,2,13,95,99,1,99,9,103,1,5,103,107,1,107,10,111,1,111,5,115,1,115,6,119,1,119,10,123,1,123,10,127,2,127,13,131,1,13,131,135,1,135,10,139,2,139,6,143,1,143,9,147,2,147,6,151,1,5,151,155,1,9,155,159,2,159,6,163,1,163,2,167,1,10,167,0,99,2,14,0,0 -------------------------------------------------------------------------------- /2019/day02/samgh96/input.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,1,13,19,1,9,19,23,2,13,23,27,2,27,13,31,2,31,10,35,1,6,35,39,1,5,39,43,1,10,43,47,1,5,47,51,1,13,51,55,2,55,9,59,1,6,59,63,1,13,63,67,1,6,67,71,1,71,10,75,2,13,75,79,1,5,79,83,2,83,6,87,1,6,87,91,1,91,13,95,1,95,13,99,2,99,13,103,1,103,5,107,2,107,10,111,1,5,111,115,1,2,115,119,1,119,6,0,99,2,0,14,0 2 | -------------------------------------------------------------------------------- /2019/day02/skgsergio/input: -------------------------------------------------------------------------------- 1 | 1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,13,1,19,1,19,9,23,1,5,23,27,1,27,9,31,1,6,31,35,2,35,9,39,1,39,6,43,2,9,43,47,1,47,6,51,2,51,9,55,1,5,55,59,2,59,6,63,1,9,63,67,1,67,10,71,1,71,13,75,2,13,75,79,1,6,79,83,2,9,83,87,1,87,6,91,2,10,91,95,2,13,95,99,1,9,99,103,1,5,103,107,2,9,107,111,1,111,5,115,1,115,5,119,1,10,119,123,1,13,123,127,1,2,127,131,1,131,13,0,99,2,14,0,0 2 | -------------------------------------------------------------------------------- /2019/day04/andsanmar/main.hs: -------------------------------------------------------------------------------- 1 | list_digits l = map (\x -> read [x] :: Int) (show l) 2 | ordered l = all (uncurry (<=)) $ zip (init l) (tail l) 3 | reps xs = [length $ filter (==x) xs | x <- [0..9]] 4 | meets x = ordered l && any (>=2) (reps l) 5 | where l = list_digits x 6 | 7 | main :: IO () 8 | main = do 9 | let list = [372037..905157] 10 | let r1 = [x | x <- list, meets x] 11 | print $ length r1 12 | print $ length [x | x <- r1, 2 `elem` (reps $ list_digits x)] 13 | 14 | -------------------------------------------------------------------------------- /2019/day04/ironjanowar/README.md: -------------------------------------------------------------------------------- 1 | # AdventCode 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `advent_code` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:advent_code, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at [https://hexdocs.pm/advent_code](https://hexdocs.pm/advent_code). 21 | 22 | -------------------------------------------------------------------------------- /2019/day04/ironjanowar/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule AdventCode.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :advent_code, 7 | version: "0.1.0", 8 | elixir: "~> 1.9", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2019/day04/ironjanowar/test/advent_code_test.exs: -------------------------------------------------------------------------------- 1 | defmodule AdventCodeTest do 2 | use ExUnit.Case 3 | doctest AdventCode 4 | end 5 | -------------------------------------------------------------------------------- /2019/day04/ironjanowar/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2019/day04/skgsergio/container.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | from collections import Counter 5 | 6 | from typing import Tuple 7 | 8 | 9 | def solve(init: int, end: int) -> Tuple[int, int]: 10 | p1c = 0 11 | p2c = 0 12 | 13 | for n in map(str, range(init, end + 1)): 14 | if list(n) == sorted(n): 15 | c = Counter(n).values() 16 | p1c += max(c) >= 2 17 | p2c += 2 in c 18 | 19 | return p1c, p2c 20 | 21 | 22 | if __name__ == '__main__': 23 | if len(sys.argv) < 2: 24 | print(f"Usage: {sys.argv[0]} <356261-846303>", file=sys.stderr) 25 | exit(1) 26 | 27 | init, end = map(int, sys.argv[1].split("-")) 28 | 29 | part1, part2 = solve(init, end) 30 | print(f"Part 1: {part1}") 31 | print(f"Part 2: {part2}") 32 | -------------------------------------------------------------------------------- /2019/day06/jfagoagas/day6.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "strings" 8 | ) 9 | 10 | var orbits []string = nil 11 | 12 | func main() { 13 | readInput() 14 | // fmt.Printf("%s\n", orbits) 15 | fmt.Printf("Part 1 -- Total orbits: %d\n", countOrbits(orbits)) 16 | } 17 | 18 | func countOrbits(orbits []string) (c int) { 19 | c = 0 20 | var count = map[string]string{} 21 | for i := range orbits { 22 | s := strings.Split(orbits[i], ")") 23 | orbits := s[1] 24 | orbited := s[0] 25 | count[orbits] = orbited 26 | } 27 | 28 | for k := range count { 29 | for i, ok := count[k]; ok; i, ok = count[i] { 30 | c++ 31 | } 32 | } 33 | 34 | return 35 | } 36 | 37 | func readInput() { 38 | input, _ := ioutil.ReadFile(os.Args[1]) 39 | orbits = strings.Split(strings.TrimSpace(string(input)), "\n") 40 | } 41 | -------------------------------------------------------------------------------- /2019/day12/skgsergio/input: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /2019/day16/skgsergio/input: -------------------------------------------------------------------------------- 1 | 59767332893712499303507927392492799842280949032647447943708128134759829623432979665638627748828769901459920331809324277257783559980682773005090812015194705678044494427656694450683470894204458322512685463108677297931475224644120088044241514984501801055776621459006306355191173838028818541852472766531691447716699929369254367590657434009446852446382913299030985023252085192396763168288943696868044543275244584834495762182333696287306000879305760028716584659188511036134905935090284404044065551054821920696749822628998776535580685208350672371545812292776910208462128008216282210434666822690603370151291219895209312686939242854295497457769408869210686246 2 | -------------------------------------------------------------------------------- /2019/day24/skgsergio/input: -------------------------------------------------------------------------------- 1 | .###. 2 | ..#.# 3 | ...## 4 | #.### 5 | ..#.. 6 | -------------------------------------------------------------------------------- /2019/day25/skgsergio/exclude: -------------------------------------------------------------------------------- 1 | molten lava 2 | escape pod 3 | giant electromagnet 4 | photons 5 | infinite loop -------------------------------------------------------------------------------- /2020/day01/Charly98cma/day01.py: -------------------------------------------------------------------------------- 1 | l = open("input.txt", "r").read().split('\n')[:-1] 2 | found = False 3 | for x in l: 4 | for y in l: 5 | if (int(x)+int(y)==2020): 6 | print("1st STAR SOLUTION ->", int(x)*int(y)) 7 | found = True 8 | break 9 | if (found): 10 | break 11 | 12 | found = False 13 | for x in l: 14 | for y in l: 15 | for z in l: 16 | if (int(x)+int(y)+int(z)==2020): 17 | print("2nd STAR SOLUTION ->", int(x)*int(y)*int(z)) 18 | found = True 19 | break 20 | if (found): 21 | break 22 | if (found): 23 | break 24 | -------------------------------------------------------------------------------- /2020/day01/FORGIS98/reportRepair.py: -------------------------------------------------------------------------------- 1 | inputFile = open("input.txt", "r") 2 | 3 | lines = inputFile.readlines() 4 | lines = list(map(int, lines)) 5 | 6 | print("Primera Estrella: ") 7 | for i in range(len(lines)): 8 | for y in range(++i, len(lines)): 9 | if(lines[i] + lines[y] == 2020): 10 | print(lines[i] * lines[y]) 11 | 12 | print("Segunda Estrella: ") 13 | for i in range(len(lines)): 14 | for y in range(++i, len(lines)): 15 | for z in range(++y, len(lines)): 16 | if(lines[i] + lines[y] + lines[z] == 2020): 17 | print(lines[i] * lines[y] * lines[z]) 18 | 19 | inputFile.close() 20 | -------------------------------------------------------------------------------- /2020/day01/andsanmar.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn star1(nums : &Vec) { 4 | for x in nums.iter() { 5 | for y in nums.iter() { 6 | if x + y == 2020 { 7 | println!("{}", x * y); 8 | return 9 | } 10 | } 11 | } 12 | } 13 | 14 | fn star2(nums : &Vec) { 15 | for x in nums.iter() { 16 | for y in nums.iter() { 17 | for z in nums.iter() { 18 | if x + y + z == 2020 { 19 | println!("{}", x * y * z); 20 | return 21 | } 22 | } 23 | } 24 | } 25 | } 26 | 27 | fn main() { 28 | let nums : Vec<_> = fs::read_to_string("input").unwrap().split_whitespace().map(|x| x.parse::().unwrap()).collect(); 29 | 30 | star1(&nums); 31 | star2(&nums); 32 | } 33 | -------------------------------------------------------------------------------- /2020/day01/davidmazarro/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = do 5 | entries <- readFile "input.txt" 6 | putStrLn $ show $ prodTwoEntriesSum2020 $ map read $ lines entries 7 | putStrLn $ show $ prodThreeEntriesSum2020 $ map read $ lines entries 8 | 9 | prodTwoEntriesSum2020 :: [Int] -> Int 10 | prodTwoEntriesSum2020 entries = 11 | head [ x * y | x <- entries, y <- entries, x + y == 2020 ] 12 | 13 | prodThreeEntriesSum2020 :: [Int] -> Int 14 | prodThreeEntriesSum2020 entries = 15 | head [ x * y * z | x <- entries, y <- entries, z <- entries, x + y + z == 2020 ] 16 | -------------------------------------------------------------------------------- /2020/day01/ignaciobll/day01.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = do 3 | input <- (fmap read) . lines <$> getContents :: IO [Int] 4 | let star1 = head $ [ x * y | x <- input, y <- input, x + y == 2020] 5 | 6 | putStrLn $ "Star 1: " ++ show star1 7 | 8 | let star2 = head $ [ x * y * z| x <- input, y <- input, z <- input, x + y + z == 2020] 9 | putStrLn $ "Star 2: " ++ show star2 10 | -------------------------------------------------------------------------------- /2020/day01/ignaciobll/doy01-example.txt: -------------------------------------------------------------------------------- 1 | 1721 2 | 979 3 | 366 4 | 299 5 | 675 6 | 1456 7 | -------------------------------------------------------------------------------- /2020/day01/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 1721 2 | 979 3 | 366 4 | 299 5 | 675 6 | 1456 -------------------------------------------------------------------------------- /2020/day02/Charly98cma/day02.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | pwdCount1 = pwdCount2 = 0 4 | for line in open('input.txt', 'r'): # {'1','3','a','abcde'} 5 | line = re.split('[-|:| ]', line.strip()) 6 | line.remove('') 7 | pwd = list(line[3]) 8 | # +1 because the top of the range is not included on the range 9 | if pwd.count(line[2]) in range(int(line[0]), int(line[1])+1): 10 | pwdCount1 += 1 11 | # -1 because arrays start at 1 (for some reason :D) 12 | if (pwd[int(line[0])-1] == line[2]) ^ (pwd[int(line[1])-1] == line[2]): 13 | pwdCount2 += 1 14 | print("Star 1 solution =", pwdCount1) 15 | print("Star 2 solution =", pwdCount2) 16 | -------------------------------------------------------------------------------- /2020/day02/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 1-3 a: abcde 2 | 1-3 b: cdefg 3 | 2-9 c: ccccccccc -------------------------------------------------------------------------------- /2020/day03/Charly98cma/day03.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | 3 | # List of lists (tree lines) 4 | forest = [] 5 | # [[col, row]] 6 | slopes = [[1,1],[3,1],[5,1],[7,1],[1,2]] 7 | trees = [[0], [0], [0], [0], [0]] 8 | 9 | for l in open("input.txt", "r"): 10 | forest.append(list(l.strip())) 11 | # Length of each tree line 12 | length = len(l.strip()) 13 | # Loop through tree lines 14 | for x in range(len(forest)): 15 | # Loop through each slope 16 | for y in range(len(slopes)): 17 | try: 18 | # [row][col] 19 | if forest[slopes[y][1]*x][(slopes[y][0]*x)%length] == '#': 20 | trees[y][0] += 1 21 | except IndexError: 22 | # Exception used to mitigate the error 23 | # introduced by the last slope 24 | pass 25 | print("1st STAR SOLUTION =", trees[1][0]) 26 | print("2nd STAR SOLUTION =", numpy.prod(trees)) 27 | -------------------------------------------------------------------------------- /2020/day03/andsanmar.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn trees_found(forest : &Vec<&str>, down : usize, right : usize) -> usize { 4 | forest.iter().enumerate().filter( 5 | |(num,line)| { num % down == 0 && { 6 | match line.chars().nth((num/down)*right % (line.len())) { 7 | Some('#') => true, 8 | _ => false 9 | } 10 | }}).count() 11 | } 12 | 13 | fn main() { 14 | let r = fs::read_to_string("input").unwrap(); 15 | let forest : Vec<&str> = r.lines().collect(); 16 | println!("{}", trees_found(&forest, 1, 3)); 17 | println!("{}", trees_found(&forest, 1, 1) * trees_found(&forest, 1, 3) * trees_found(&forest, 1, 5) * trees_found(&forest, 1, 7) * trees_found(&forest, 2, 1)); 18 | } 19 | -------------------------------------------------------------------------------- /2020/day03/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | ..##....... 2 | #...#...#.. 3 | .#....#..#. 4 | ..#.#...#.# 5 | .#...##..#. 6 | ..#.##..... 7 | .#.#.#....# 8 | .#........# 9 | #.##...#... 10 | #...##....# 11 | .#..#...#.# 12 | -------------------------------------------------------------------------------- /2020/day03/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | ..##....... 2 | #...#...#.. 3 | .#....#..#. 4 | ..#.#...#.# 5 | .#...##..#. 6 | ..#.##..... 7 | .#.#.#....# 8 | .#........# 9 | #.##...#... 10 | #...##....# 11 | .#..#...#.# -------------------------------------------------------------------------------- /2020/day04/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | ecl:gry pid:860033327 eyr:2020 hcl:#fffffd 2 | byr:1937 iyr:2017 cid:147 hgt:183cm 3 | 4 | iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 5 | hcl:#cfa07d byr:1929 6 | 7 | hcl:#ae17e1 iyr:2013 8 | eyr:2024 9 | ecl:brn pid:760753108 byr:1931 10 | hgt:179cm 11 | 12 | hcl:#cfa07d eyr:2025 pid:166559648 13 | iyr:2011 ecl:brn hgt:59in -------------------------------------------------------------------------------- /2020/day04/rockneurotiko/invalids: -------------------------------------------------------------------------------- 1 | eyr:1972 cid:100 2 | hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926 3 | 4 | iyr:2019 5 | hcl:#602927 eyr:1967 hgt:170cm 6 | ecl:grn pid:012533040 byr:1946 7 | 8 | hcl:dab227 iyr:2012 9 | ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277 10 | 11 | hgt:59cm ecl:zzz 12 | eyr:2038 hcl:74454a iyr:2023 13 | pid:3556412378 byr:2007 -------------------------------------------------------------------------------- /2020/day04/rockneurotiko/valids: -------------------------------------------------------------------------------- 1 | pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980 2 | hcl:#623a2f 3 | 4 | eyr:2029 ecl:blu cid:129 byr:1989 5 | iyr:2014 pid:896056539 hcl:#a97842 hgt:165cm 6 | 7 | hcl:#888785 8 | hgt:164cm byr:2001 iyr:2015 cid:88 9 | pid:545766238 ecl:hzl 10 | eyr:2022 11 | 12 | iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719 -------------------------------------------------------------------------------- /2020/day05/Charly98cma/day05.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import sys 3 | 4 | passes = {int(l.translate(str.maketrans('FBLR', '0101')), 2) for l in open(sys.argv[1],'r')} 5 | print("1st STAR SOLUTION ->", max(passes)) 6 | print("2nd STAR SOLUTION ->", set(range(min(passes), max(passes))) - passes) 7 | -------------------------------------------------------------------------------- /2020/day05/andsanmar.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn main() { 4 | let r = fs::read_to_string("input").unwrap(); 5 | let mut passes_ids : Vec = r.lines().map(|l| { 6 | u16::from_str_radix(l.chars().map(|c| match c { 7 | 'B' | 'R' => '1', 8 | _ => '0' 9 | }).collect::().as_str(), 2).unwrap() 10 | }).collect(); 11 | passes_ids.sort(); 12 | println!("{:?}", passes_ids.last()); 13 | let c = passes_ids[0]; 14 | for (x, n) in passes_ids.iter().enumerate() { 15 | if n - x as u16 != c { 16 | println!("{:?}", n-1); // The previous entry was missing 17 | break 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /2020/day05/csanchez/day05.py: -------------------------------------------------------------------------------- 1 | f = open('input.txt') 2 | 3 | puzzle = f.read().split('\n') 4 | 5 | # According to the script, the given string can be converted directly to a binary number. int(x,2) converts a binary string to a decimal integer. 6 | unique_ids = [int(x.replace('F', '0').replace('B', '1').replace('R', '1').replace('L', '0'),2) for x in puzzle] 7 | print('First star solution: ', max(unique_ids)) 8 | 9 | unique_ids_sorted = sorted(unique_ids) 10 | 11 | right_idx = 1 12 | seat_id = -1 13 | while right_idx < len(unique_ids_sorted): 14 | if unique_ids_sorted[right_idx] - unique_ids_sorted[right_idx-1] == 2: 15 | seat_id = unique_ids_sorted[right_idx]-1 16 | break 17 | right_idx +=1 18 | 19 | print('Second star solution: ', seat_id) -------------------------------------------------------------------------------- /2020/day05/cuwano/input_test: -------------------------------------------------------------------------------- 1 | BFFFBBFRRR 2 | FFFBBBFRRR 3 | BBFFBBFRLL -------------------------------------------------------------------------------- /2020/day05/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | BFFFBBFRRR 2 | FFFBBBFRRR 3 | BBFFBBFRLL -------------------------------------------------------------------------------- /2020/day06/Charly98cma/day06.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | count1st = 0 4 | count2nd = 0 5 | group = dict() 6 | numLines = 0 7 | for l in open(sys.argv[1],'r'): 8 | l = l.strip() 9 | if not l: 10 | # Empty line 11 | count1st += len(group) 12 | # Key is not necessary 13 | for key,value in group.items(): 14 | if value == numLines: 15 | count2nd += 1 16 | # Reset values for next group of answers 17 | group = dict() 18 | numLines = 0 19 | else: 20 | # Not empty line 21 | numLines += 1 22 | for ans in list(l): 23 | if ans in group: 24 | group[ans] += 1 25 | else: 26 | group[ans] = 1 27 | print("1st STAR SOLUTION ->", count1st) 28 | print("2nd STAR SOLUTION ->", count2nd) 29 | -------------------------------------------------------------------------------- /2020/day06/andsanmar.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn main() { 4 | let r = fs::read_to_string("input").unwrap(); 5 | let all_questions = r.split("\n\n").map( |x| { 6 | let mut q : Vec = x.lines().map(|l| l.chars()).flatten().collect(); 7 | q.sort(); 8 | q.dedup(); 9 | q 10 | }); 11 | println!("{}", all_questions.map(|x| x.len()).sum::()); 12 | let questions_common = r.split("\n\n").map( |x| { 13 | let q : Vec> = x.lines().map(|x| x.chars().collect()).collect(); 14 | q.iter().fold(q.first().unwrap().to_vec(), |all_answered, lq| // Compute vecs intersection 15 | lq.iter().filter(|e| all_answered.contains(e)).map(|x| *x).collect::>() 16 | ) 17 | }); 18 | println!("{}", questions_common.map(|x| x.len()).sum::()); 19 | } 20 | -------------------------------------------------------------------------------- /2020/day06/csanchez/day06.py: -------------------------------------------------------------------------------- 1 | import functools 2 | from collections import Counter 3 | 4 | f = open('input.txt') 5 | 6 | groups = [group.split('\n') for group in f.read().split('\n\n')] 7 | 8 | yes_cells = 0 9 | 10 | for group in groups: 11 | cells = list(dict.fromkeys(functools.reduce(lambda a,b: a+b, group))) 12 | yes_cells += len(cells) 13 | 14 | print('First star solution: ', yes_cells) 15 | 16 | everyone_yes_cells = 0 17 | 18 | for group in groups: 19 | n_group = len(group) 20 | counter = Counter(list(functools.reduce(lambda a,b: a+b, group))) 21 | everyone_yes_cells += len(list(filter(lambda n: n == n_group, counter.values()))) 22 | 23 | print('Second star solution: ', everyone_yes_cells) -------------------------------------------------------------------------------- /2020/day06/cuwano/input_test: -------------------------------------------------------------------------------- 1 | abc 2 | 3 | a 4 | b 5 | c 6 | 7 | ab 8 | ac 9 | 10 | a 11 | a 12 | a 13 | a 14 | 15 | b -------------------------------------------------------------------------------- /2020/day06/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | abc 2 | 3 | a 4 | b 5 | c 6 | 7 | ab 8 | ac 9 | 10 | a 11 | a 12 | a 13 | a 14 | 15 | b -------------------------------------------------------------------------------- /2020/day07/Charly98cma/day07.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | bags = ['shiny gold'] 4 | rules = [rule.split(' contain ') for rule in open(sys.argv[1],'r').read().replace('.','').replace(' bags','').split('\n')[:-1]] 5 | 6 | print("1st STAR SOLUTION ->", len([bags.append(x[0]) for bag in bags for x in rules if (bag in x[1] and x[0] not in bags)])) 7 | -------------------------------------------------------------------------------- /2020/day07/FORGIS98/handyHaversacks.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import re 3 | 4 | MYBAG = "shiny gold" 5 | yaContados = [] 6 | puntero = 0 7 | 8 | for firstPointer in reversed(list(open(sys.argv[1]))): 9 | for secondPointer in reversed(list(open(sys.argv[1]))): 10 | secondPointer = secondPointer.rstrip() 11 | 12 | rx = re.match(r'.* bags contain (?P.*)', secondPointer) 13 | bigBag = re.match(r'(?P.*) bags contain', secondPointer) 14 | 15 | if(MYBAG in rx.group("otherBag") and not (bigBag.group("bag") in yaContados)): 16 | yaContados.append(bigBag.group("bag")) 17 | 18 | if(puntero < len(yaContados)): 19 | MYBAG = yaContados[puntero] 20 | puntero += 1 21 | else: 22 | break 23 | 24 | print(len(yaContados)) 25 | -------------------------------------------------------------------------------- /2020/day07/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | light red bags contain 1 bright white bag, 2 muted yellow bags. 2 | dark orange bags contain 3 bright white bags, 4 muted yellow bags. 3 | bright white bags contain 1 shiny gold bag. 4 | muted yellow bags contain 2 shiny gold bags, 9 faded blue bags. 5 | shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags. 6 | dark olive bags contain 3 faded blue bags, 4 dotted black bags. 7 | vibrant plum bags contain 5 faded blue bags, 6 dotted black bags. 8 | faded blue bags contain no other bags. 9 | dotted black bags contain no other bags. -------------------------------------------------------------------------------- /2020/day07/rockneurotiko/input_test2: -------------------------------------------------------------------------------- 1 | shiny gold bags contain 2 dark red bags. 2 | dark red bags contain 2 dark orange bags. 3 | dark orange bags contain 2 dark yellow bags. 4 | dark yellow bags contain 2 dark green bags. 5 | dark green bags contain 2 dark blue bags. 6 | dark blue bags contain 2 dark violet bags. 7 | dark violet bags contain no other bags. -------------------------------------------------------------------------------- /2020/day08/FORGIS98/handheldHalting.py: -------------------------------------------------------------------------------- 1 | import re 2 | import sys 3 | 4 | myFile = open(sys.argv[1], "r") 5 | lines = myFile.readlines() 6 | 7 | lines = list(map(lambda x: x.rstrip(), lines)) 8 | 9 | accumulator = 0 10 | executed = [] 11 | PC = 0 12 | 13 | while PC not in executed: 14 | rx = re.match(r'(?P\w+) (?P[+-]\d+)', lines[PC]) 15 | 16 | if(rx.group("op") == "jmp"): 17 | executed.append(PC) 18 | PC += int(rx.group("val")) 19 | elif(rx.group("op") == "acc"): 20 | executed.append(PC) 21 | accumulator += int(rx.group("val")) 22 | PC += 1 23 | else: 24 | executed.append(PC) 25 | PC += 1 26 | 27 | print(accumulator) 28 | -------------------------------------------------------------------------------- /2020/day08/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | nop +0 2 | acc +1 3 | jmp +4 4 | acc +3 5 | jmp -3 6 | acc -99 7 | acc +1 8 | jmp -4 9 | acc +6 10 | -------------------------------------------------------------------------------- /2020/day08/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | nop +0 2 | acc +1 3 | jmp +4 4 | acc +3 5 | jmp -3 6 | acc -99 7 | acc +1 8 | jmp -4 9 | acc +6 -------------------------------------------------------------------------------- /2020/day09/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | 35 2 | 20 3 | 15 4 | 25 5 | 47 6 | 40 7 | 62 8 | 55 9 | 65 10 | 95 11 | 102 12 | 117 13 | 150 14 | 182 15 | 127 16 | 219 17 | 299 18 | 277 19 | 309 20 | 576 21 | -------------------------------------------------------------------------------- /2020/day09/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 35 2 | 20 3 | 15 4 | 25 5 | 47 6 | 40 7 | 62 8 | 55 9 | 65 10 | 95 11 | 102 12 | 117 13 | 150 14 | 182 15 | 127 16 | 219 17 | 299 18 | 277 19 | 309 20 | 576 -------------------------------------------------------------------------------- /2020/day10/FORGIS98/adapterArray.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | println "" 3 | 4 | def input = new File(args[0]) as String[]; 5 | input = input.collect {it.toInteger()}; 6 | input = input.sort(); 7 | input.add(0, 0); 8 | 9 | def difUno = 0 10 | def difTres = 1 11 | 12 | (input.size()-1).times{ 13 | if((input[it]+1) == input[it+1]) 14 | difUno += 1 15 | else if((input[it]+3) == input[it+1]) 16 | difTres += 1 17 | } 18 | 19 | println (difUno * difTres) 20 | 21 | -------------------------------------------------------------------------------- /2020/day10/FORGIS98/input.txt: -------------------------------------------------------------------------------- 1 | 114 2 | 51 3 | 122 4 | 26 5 | 121 6 | 90 7 | 20 8 | 113 9 | 8 10 | 138 11 | 57 12 | 44 13 | 135 14 | 76 15 | 134 16 | 15 17 | 21 18 | 119 19 | 52 20 | 118 21 | 107 22 | 99 23 | 73 24 | 72 25 | 106 26 | 41 27 | 129 28 | 83 29 | 19 30 | 66 31 | 132 32 | 56 33 | 32 34 | 79 35 | 27 36 | 115 37 | 112 38 | 58 39 | 102 40 | 64 41 | 50 42 | 2 43 | 39 44 | 3 45 | 77 46 | 85 47 | 103 48 | 140 49 | 28 50 | 133 51 | 78 52 | 34 53 | 13 54 | 61 55 | 25 56 | 35 57 | 89 58 | 40 59 | 7 60 | 24 61 | 33 62 | 96 63 | 108 64 | 71 65 | 11 66 | 128 67 | 92 68 | 111 69 | 55 70 | 80 71 | 91 72 | 31 73 | 70 74 | 101 75 | 14 76 | 18 77 | 12 78 | 4 79 | 84 80 | 125 81 | 120 82 | 100 83 | 65 84 | 86 85 | 93 86 | 67 87 | 139 88 | 1 89 | 47 90 | 38 91 | -------------------------------------------------------------------------------- /2020/day10/aafrecct/input2: -------------------------------------------------------------------------------- 1 | 28 2 | 33 3 | 18 4 | 42 5 | 31 6 | 14 7 | 46 8 | 20 9 | 48 10 | 47 11 | 24 12 | 23 13 | 49 14 | 45 15 | 19 16 | 38 17 | 39 18 | 11 19 | 1 20 | 32 21 | 25 22 | 35 23 | 8 24 | 17 25 | 7 26 | 9 27 | 4 28 | 2 29 | 34 30 | 10 31 | 3 32 | -------------------------------------------------------------------------------- /2020/day10/davidmazarro/input.txt: -------------------------------------------------------------------------------- 1 | 38 2 | 23 3 | 31 4 | 16 5 | 141 6 | 2 7 | 124 8 | 25 9 | 37 10 | 147 11 | 86 12 | 150 13 | 99 14 | 75 15 | 81 16 | 121 17 | 93 18 | 120 19 | 96 20 | 55 21 | 48 22 | 58 23 | 108 24 | 22 25 | 132 26 | 62 27 | 107 28 | 54 29 | 69 30 | 51 31 | 7 32 | 134 33 | 143 34 | 122 35 | 28 36 | 60 37 | 123 38 | 82 39 | 95 40 | 14 41 | 6 42 | 106 43 | 41 44 | 131 45 | 109 46 | 90 47 | 112 48 | 1 49 | 103 50 | 44 51 | 127 52 | 9 53 | 83 54 | 59 55 | 117 56 | 8 57 | 140 58 | 151 59 | 89 60 | 35 61 | 148 62 | 76 63 | 100 64 | 114 65 | 130 66 | 19 67 | 72 68 | 36 69 | 133 70 | 12 71 | 34 72 | 46 73 | 15 74 | 45 75 | 87 76 | 144 77 | 80 78 | 13 79 | 142 80 | 149 81 | 88 82 | 94 83 | 61 84 | 154 85 | 24 86 | 66 87 | 113 88 | 5 89 | 73 90 | 79 91 | 74 92 | 65 93 | 137 94 | 47 95 | -------------------------------------------------------------------------------- /2020/day10/ignaciobll/day10.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack --resolver lts-16.24 script 3 | 4 | import Data.List (sort) 5 | 6 | main :: IO () 7 | main = do 8 | input <- (fmap read) . lines <$> readFile "input.txt" :: IO [Int] 9 | putStrLn $ "Star 1: " ++ show (star1 input) 10 | 11 | 12 | star1 :: [Int] -> Int 13 | star1 = (\(o, t) -> o * t) . foldr count (1, 1) . joltDiff . sort 14 | where 15 | count :: Int -> (Int, Int) -> (Int, Int) 16 | count 1 (acc1, acc3) = (succ acc1, acc3) 17 | count 3 (acc1, acc3) = (acc1, succ acc3) 18 | count _ acc = acc 19 | 20 | joltDiff :: [Int] -> [Int] 21 | joltDiff [] = [] 22 | joltDiff xs@(_:xs') = zipWith (-) xs' xs 23 | -------------------------------------------------------------------------------- /2020/day10/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | 28 2 | 33 3 | 18 4 | 42 5 | 31 6 | 14 7 | 46 8 | 20 9 | 48 10 | 47 11 | 24 12 | 23 13 | 49 14 | 45 15 | 19 16 | 38 17 | 39 18 | 11 19 | 1 20 | 32 21 | 25 22 | 35 23 | 8 24 | 17 25 | 7 26 | 9 27 | 4 28 | 2 29 | 34 30 | 10 31 | 3 32 | -------------------------------------------------------------------------------- /2020/day10/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | 138 2 | 3 3 | 108 4 | 64 5 | 92 6 | 112 7 | 44 8 | 53 9 | 27 10 | 20 11 | 23 12 | 77 13 | 119 14 | 62 15 | 121 16 | 11 17 | 2 18 | 37 19 | 148 20 | 34 21 | 83 22 | 24 23 | 10 24 | 79 25 | 96 26 | 98 27 | 127 28 | 7 29 | 115 30 | 19 31 | 16 32 | 78 33 | 133 34 | 61 35 | 82 36 | 91 37 | 145 38 | 39 39 | 33 40 | 13 41 | 97 42 | 55 43 | 141 44 | 1 45 | 134 46 | 40 47 | 71 48 | 54 49 | 103 50 | 101 51 | 26 52 | 47 53 | 90 54 | 72 55 | 126 56 | 124 57 | 110 58 | 131 59 | 58 60 | 12 61 | 142 62 | 105 63 | 63 64 | 75 65 | 50 66 | 95 67 | 69 68 | 25 69 | 68 70 | 144 71 | 86 72 | 132 73 | 89 74 | 128 75 | 135 76 | 65 77 | 125 78 | 76 79 | 116 80 | 32 81 | 18 82 | 6 83 | 38 84 | 109 85 | 111 86 | 30 87 | 70 88 | 143 89 | 104 90 | 102 91 | 120 92 | 31 93 | 41 94 | 17 95 | -------------------------------------------------------------------------------- /2020/day10/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 16 2 | 10 3 | 15 4 | 5 5 | 1 6 | 11 7 | 7 8 | 19 9 | 6 10 | 12 11 | 4 -------------------------------------------------------------------------------- /2020/day10/rockneurotiko/input_test2: -------------------------------------------------------------------------------- 1 | 28 2 | 33 3 | 18 4 | 42 5 | 31 6 | 14 7 | 46 8 | 20 9 | 48 10 | 47 11 | 24 12 | 23 13 | 49 14 | 45 15 | 19 16 | 38 17 | 39 18 | 11 19 | 1 20 | 32 21 | 25 22 | 35 23 | 8 24 | 17 25 | 7 26 | 9 27 | 4 28 | 2 29 | 34 30 | 10 31 | 3 -------------------------------------------------------------------------------- /2020/day11/aafreect/day11.py: -------------------------------------------------------------------------------- 1 | from sys import argv, exit 2 | from os import listdir 3 | 4 | if len(argv) == 2 and argv[1] in listdir('./'): 5 | filename = argv[1] 6 | elif 'input' in listdir('./'): 7 | filename = 'input' 8 | else: 9 | print("Not a valid input file.") 10 | exit() 11 | 12 | with open(filename, 'r') as f: 13 | seatmatrix = [] 14 | values = {'.':-1, 'L':0, '#':1} 15 | for l in f: 16 | seatmatrix.append([values[c] for c in l]) 17 | 18 | def surrounding_seats(seat, matrix): 19 | s = ma 20 | return sum([]) 21 | 22 | def step(matrix) 23 | copy = [row.copy() for row in matrix] 24 | for row in len(matrix): 25 | for seat in len(matrix[row]): 26 | ] 27 | -------------------------------------------------------------------------------- /2020/day11/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | L.LL.LL.LL 2 | LLLLLLL.LL 3 | L.L.L..L.. 4 | LLLL.LL.LL 5 | L.LL.LL.LL 6 | L.LLLLL.LL 7 | ..L.L..... 8 | LLLLLLLLLL 9 | L.LLLLLL.L 10 | L.LLLLL.LL 11 | -------------------------------------------------------------------------------- /2020/day11/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | L.LL.LL.LL 2 | LLLLLLL.LL 3 | L.L.L..L.. 4 | LLLL.LL.LL 5 | L.LL.LL.LL 6 | L.LLLLL.LL 7 | ..L.L..... 8 | LLLLLLLLLL 9 | L.LLLLLL.L 10 | L.LLLLL.LL -------------------------------------------------------------------------------- /2020/day12/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | F10 2 | N3 3 | F7 4 | R90 5 | F11 6 | -------------------------------------------------------------------------------- /2020/day12/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | F10 2 | N3 3 | F7 4 | R90 5 | F11 -------------------------------------------------------------------------------- /2020/day13/davidmazarro/input.txt: -------------------------------------------------------------------------------- 1 | 1000655 2 | 17,x,x,x,x,x,x,x,x,x,x,37,x,x,x,x,x,571,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,13,x,x,x,x,23,x,x,x,x,x,29,x,401,x,x,x,x,x,x,x,x,x,41,x,x,x,x,x,x,x,x,19 3 | -------------------------------------------------------------------------------- /2020/day13/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | 939 2 | 7,13,x,x,59,x,31,19 3 | -------------------------------------------------------------------------------- /2020/day13/ignaciobll/input.txt: -------------------------------------------------------------------------------- 1 | 1005595 2 | 41,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,37,x,x,x,x,x,557,x,29,x,x,x,x,x,x,x,x,x,x,13,x,x,x,17,x,x,x,x,x,23,x,x,x,x,x,x,x,419,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,19 3 | -------------------------------------------------------------------------------- /2020/day13/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | 1013728 2 | 23,x,x,x,x,x,x,x,x,x,x,x,x,41,x,x,x,x,x,x,x,x,x,733,x,x,x,x,x,x,x,x,x,x,x,x,13,17,x,x,x,x,19,x,x,x,x,x,x,x,x,x,29,x,449,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,37 3 | -------------------------------------------------------------------------------- /2020/day13/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 939 2 | 7,13,x,x,59,x,31,19 -------------------------------------------------------------------------------- /2020/day14/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X 2 | mem[8] = 11 3 | mem[7] = 101 4 | mem[8] = 0 5 | -------------------------------------------------------------------------------- /2020/day14/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X 2 | mem[8] = 11 3 | mem[7] = 101 4 | mem[8] = 0 -------------------------------------------------------------------------------- /2020/day14/rockneurotiko/input_test2: -------------------------------------------------------------------------------- 1 | mask = 000000000000000000000000000000X1001X 2 | mem[42] = 100 3 | mask = 00000000000000000000000000000000X0XX 4 | mem[26] = 1 -------------------------------------------------------------------------------- /2020/day15/davidmazarro/input.txt: -------------------------------------------------------------------------------- 1 | 5,2,8,16,18,0,1 2 | -------------------------------------------------------------------------------- /2020/day15/petacreepers23/day15.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2020/day15/petacreepers23/day15.cpp -------------------------------------------------------------------------------- /2020/day15/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | 14,1,17,0,3,20 -------------------------------------------------------------------------------- /2020/day15/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 0,3,6 -------------------------------------------------------------------------------- /2020/day16/petacreepers23/day16.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2020/day16/petacreepers23/day16.cpp -------------------------------------------------------------------------------- /2020/day16/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | class: 1-3 or 5-7 2 | row: 6-11 or 33-44 3 | seat: 13-40 or 45-50 4 | 5 | your ticket: 6 | 7,1,14 7 | 8 | nearby tickets: 9 | 7,3,47 10 | 40,4,50 11 | 55,2,20 12 | 38,6,12 -------------------------------------------------------------------------------- /2020/day17/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | .#. 2 | ..# 3 | ### 4 | -------------------------------------------------------------------------------- /2020/day17/ignaciobll/input.txt: -------------------------------------------------------------------------------- 1 | #......# 2 | ##.#..#. 3 | #.#.###. 4 | .##..... 5 | .##.#... 6 | ##.#.... 7 | #####.#. 8 | ##.#.### 9 | -------------------------------------------------------------------------------- /2020/day17/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | #.#####. 2 | #..##... 3 | .##..#.. 4 | #.##.### 5 | .#.#.#.. 6 | #.##..#. 7 | #####..# 8 | ..#.#.## 9 | -------------------------------------------------------------------------------- /2020/day17/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | .#. 2 | ..# 3 | ### -------------------------------------------------------------------------------- /2020/day18/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 1 + 2 * 3 + 4 * 5 + 6 2 | 2 * 3 + (4 * 5) 3 | 5 + (8 * 3 + 9 + 3 * 4 * 3) 4 | 5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4)) 5 | ((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2 -------------------------------------------------------------------------------- /2020/day19/ignaciobll/example.txt: -------------------------------------------------------------------------------- 1 | 0: 4 1 5 2 | 1: 2 3 | 3 2 3 | 2: 4 4 | 5 5 4 | 3: 4 5 | 5 4 5 | 4: "a" 6 | 5: "b" 7 | 8 | ababbb 9 | bababa 10 | abbbab 11 | aaabbb 12 | aaaabbb 13 | -------------------------------------------------------------------------------- /2020/day19/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 0: 4 1 5 2 | 1: 2 3 | 3 2 3 | 2: 4 4 | 5 5 4 | 3: 4 5 | 5 4 5 | 4: "a" 6 | 5: "b" 7 | 8 | ababbb 9 | bababa 10 | abbbab 11 | aaabbb 12 | aaaabbb -------------------------------------------------------------------------------- /2020/day19/rockneurotiko/input_test3: -------------------------------------------------------------------------------- 1 | 42: 9 14 | 10 1 2 | 9: 14 27 | 1 26 3 | 10: 23 14 | 28 1 4 | 1: "a" 5 | 11: 42 31 6 | 5: 1 14 | 15 1 7 | 19: 14 1 | 14 14 8 | 12: 24 14 | 19 1 9 | 16: 15 1 | 14 14 10 | 31: 14 17 | 1 13 11 | 6: 14 14 | 1 14 12 | 2: 1 24 | 14 4 13 | 0: 8 11 14 | 13: 14 3 | 1 12 15 | 15: 1 | 14 16 | 17: 14 2 | 1 7 17 | 23: 25 1 | 22 14 18 | 28: 16 1 19 | 4: 1 1 20 | 20: 14 14 | 1 15 21 | 3: 5 14 | 16 1 22 | 27: 1 6 | 14 18 23 | 14: "b" 24 | 21: 14 1 | 1 14 25 | 25: 1 1 | 1 14 26 | 22: 14 14 27 | 8: 42 28 | 26: 14 22 | 1 20 29 | 18: 15 15 30 | 7: 14 5 | 1 21 31 | 24: 14 1 32 | 33 | babbbbaabbbbbabbbbbbaabaaabaaa -------------------------------------------------------------------------------- /2020/day19/rockneurotiko/python: -------------------------------------------------------------------------------- 1 | input test.py 2 | -------------------------------------------------------------------------------- /2020/day21/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | mxmxvkd kfcds sqjhc nhms (contains dairy, fish) 2 | trh fvjkl sbzzf mxmxvkd (contains dairy) 3 | sqjhc fvjkl (contains soy) 4 | sqjhc mxmxvkd sbzzf (contains fish) -------------------------------------------------------------------------------- /2020/day22/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | Player 1: 2 | 23 3 | 32 4 | 46 5 | 47 6 | 27 7 | 35 8 | 1 9 | 16 10 | 37 11 | 50 12 | 15 13 | 11 14 | 14 15 | 31 16 | 4 17 | 38 18 | 21 19 | 39 20 | 26 21 | 22 22 | 3 23 | 2 24 | 8 25 | 45 26 | 19 27 | 28 | Player 2: 29 | 13 30 | 20 31 | 12 32 | 28 33 | 9 34 | 10 35 | 30 36 | 25 37 | 18 38 | 36 39 | 48 40 | 41 41 | 29 42 | 24 43 | 49 44 | 33 45 | 44 46 | 40 47 | 6 48 | 34 49 | 7 50 | 43 51 | 42 52 | 17 53 | 5 54 | -------------------------------------------------------------------------------- /2020/day22/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | Player 1: 2 | 9 3 | 2 4 | 6 5 | 3 6 | 1 7 | 8 | Player 2: 9 | 5 10 | 8 11 | 4 12 | 7 13 | 10 -------------------------------------------------------------------------------- /2020/day22/rockneurotiko/input_test2: -------------------------------------------------------------------------------- 1 | Player 1: 2 | 43 3 | 19 4 | 5 | Player 2: 6 | 2 7 | 29 8 | 14 -------------------------------------------------------------------------------- /2020/day23/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | 318946572 2 | -------------------------------------------------------------------------------- /2020/day23/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 389125467 -------------------------------------------------------------------------------- /2020/day24/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | sesenwnenenewseeswwswswwnenewsewsw 2 | neeenesenwnwwswnenewnwwsewnenwseswesw 3 | seswneswswsenwwnwse 4 | nwnwneseeswswnenewneswwnewseswneseene 5 | swweswneswnenwsewnwneneseenw 6 | eesenwseswswnenwswnwnwsewwnwsene 7 | sewnenenenesenwsewnenwwwse 8 | wenwwweseeeweswwwnwwe 9 | wsweesenenewnwwnwsenewsenwwsesesenwne 10 | neeswseenwwswnwswswnw 11 | nenwswwsewswnenenewsenwsenwnesesenew 12 | enewnwewneswsewnwswenweswnenwsenwsw 13 | sweneswneswneneenwnewenewwneswswnese 14 | swwesenesewenwneswnwwneseswwne 15 | enesenwswwswneneswsenwnewswseenwsese 16 | wnwnesenesenenwwnenwsewesewsesesew 17 | nenewswnwewswnenesenwnesewesw 18 | eneswnwswnwsenenwnwnwwseeswneewsenese 19 | neswnwewnwnwseenwseesewsenwsweewe 20 | wseweeenwnesenwwwswnew -------------------------------------------------------------------------------- /2020/day25/andsanmar.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn retrieve_loop_size(pk : usize) -> usize { 4 | let subject_number = 7; 5 | let mut value : usize = 1; 6 | let mut loop_size = 0; 7 | while value != pk { 8 | value = (value*subject_number) % 20201227; 9 | loop_size += 1; 10 | } 11 | loop_size 12 | } 13 | 14 | fn main() { 15 | let n: Vec = fs::read_to_string("input").unwrap().lines().map(|x| x.parse::().unwrap()).collect(); 16 | let door_pk = n[0]; 17 | let card_pk = n[1]; 18 | let door_sk = retrieve_loop_size(door_pk); 19 | // let card_sk = retrieve_loop_size(card_pk); 20 | let encryption_key = (0..door_sk).fold(1,|value,_| (value*card_pk) % 20201227); 21 | // let encryption_key = (0..card_sk).fold(1,|value,_| (value*door_pk) % 20201227); 22 | println!("{}", encryption_key); 23 | } 24 | -------------------------------------------------------------------------------- /2020/day25/rockneurotiko/input: -------------------------------------------------------------------------------- 1 | 2959251 2 | 4542595 3 | -------------------------------------------------------------------------------- /2020/day25/rockneurotiko/input_test: -------------------------------------------------------------------------------- 1 | 5764801 2 | 17807724 -------------------------------------------------------------------------------- /2021/day01/aafrecct/__main__.py: -------------------------------------------------------------------------------- 1 | from sys import stdin 2 | 3 | nums = list(map(int, stdin)) 4 | star1 = sum([int(t[1] > t[0]) for t in zip(nums[:-1], nums[1:])]) 5 | star2 = sum([int(sum(nums[i+1:i+4]) > sum(nums[i:i+3])) for i in range(len(nums) - 2)]) 6 | print(star1, star2) 7 | -------------------------------------------------------------------------------- /2021/day01/andsanmar.rs: -------------------------------------------------------------------------------- 1 | fn star1(l : &Vec) { 2 | println!("{}", l.iter().skip(1).zip(l).filter(|(a,b)| a>b).count()); 3 | } 4 | 5 | fn star2(l : &Vec) { 6 | println!("{}", l.iter().skip(3).zip(l).filter(|(a,b)| a>b).count()); 7 | } 8 | 9 | fn main() { 10 | let args: Vec = std::env::args().collect(); 11 | if args.len() < 2 { 12 | eprintln!("Feed me with the input!"); 13 | std::process::exit(1); 14 | }; 15 | let l : Vec = std::fs::read_to_string(args[1].clone()).unwrap().lines().filter_map(|l| match l.parse() { 16 | Ok(n) => Some(n), 17 | _ => None 18 | }).collect(); 19 | 20 | star1(&l); 21 | star2(&l); 22 | } 23 | -------------------------------------------------------------------------------- /2021/day01/casamatechs/day01.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | f = open('input') 4 | data = [int(number) for number in f.readlines()] 5 | 6 | def countIncrements(data): 7 | cnt = 0 8 | for idx in range(len(data)-1): 9 | if data[idx+1] > data[idx]: 10 | cnt += 1 11 | print(cnt) 12 | 13 | countIncrements(data) 14 | 15 | def windowIncrements(data): 16 | cnt = 0 17 | for idx in range(len(data)-3): 18 | a = np.sum(data[idx:idx+3]) 19 | b = np.sum(data[idx+1:idx+4]) 20 | if b > a: 21 | cnt += 1 22 | print(cnt) 23 | 24 | windowIncrements(data) -------------------------------------------------------------------------------- /2021/day01/jasviers/main.py: -------------------------------------------------------------------------------- 1 | def increased_count(list): 2 | acc = 0 3 | last = list[0] 4 | 5 | for elem in list[1::]: 6 | if elem > last: 7 | acc += 1 8 | last = elem 9 | return acc 10 | 11 | def sliding(list): 12 | i = 0 13 | elems = [] 14 | while i < len(list)-2: 15 | elems.append(sum([list[i], list[i+1], list[i+2]])) 16 | i += 1 17 | return elems 18 | 19 | if __name__ == "__main__": 20 | with open("./input", "r") as fd: 21 | list = list(map(int, fd.readlines())) 22 | 23 | print("First:", increased_count(list)) 24 | print("Second:", increased_count(sliding(list))) -------------------------------------------------------------------------------- /2021/day01/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day01 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day01/jfagoagas/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2021/day01/jfagoagas/go.sum -------------------------------------------------------------------------------- /2021/day01/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day01skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day01/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day02/casamatechs/day02.py: -------------------------------------------------------------------------------- 1 | f = open('input') 2 | data = [line for line in f.readlines()] 3 | 4 | def movementAxis(data): 5 | x = 0 6 | y = 0 7 | for text, num in [l.split(' ') for l in data]: 8 | num = int(num) 9 | if text == 'forward': 10 | x += num 11 | elif text == 'down': 12 | y += num 13 | else: 14 | y -= num 15 | print(x*y) 16 | 17 | movementAxis(data) 18 | 19 | def movementAim(data): 20 | x = 0 21 | y = 0 22 | aim = 0 23 | for text, num in [l.split(' ') for l in data]: 24 | num = int(num) 25 | if text == 'forward': 26 | x += num 27 | y += aim * num 28 | elif text == 'down': 29 | aim += num 30 | else: 31 | aim -= num 32 | print(x*y) 33 | 34 | movementAim(data) -------------------------------------------------------------------------------- /2021/day02/jasviers/main.py: -------------------------------------------------------------------------------- 1 | position = [0, 0, 0] 2 | 3 | def forward(n): 4 | position[0] += n 5 | if position[1] > 0: 6 | position[2] += n * position[1] 7 | 8 | def up(n): 9 | position[1] -= n 10 | 11 | def down(n): 12 | position[1] += n 13 | 14 | def depth(list): 15 | for e in list: 16 | e = e.split() 17 | eval(f"{e[0]}({e[1]})") 18 | return position[0] * position[1] 19 | 20 | def aim(list): 21 | for e in list: 22 | e = e.split() 23 | eval(f"{e[0]}({e[1]})") 24 | return position[0] * position[2] 25 | 26 | if __name__ == "__main__": 27 | with open("./input", "r") as fd: 28 | list = fd.readlines() 29 | 30 | #print("First:", depth(list)) 31 | print("Second:", aim(list)) -------------------------------------------------------------------------------- /2021/day02/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day02 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day02/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day02skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day02/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day03/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day03 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day03/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day03skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day03/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day04/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day04 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day04/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day04skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day04/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day05/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day05 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day05/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day05skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day05/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day05/skgsergio/plot_with_diagonals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2021/day05/skgsergio/plot_with_diagonals.png -------------------------------------------------------------------------------- /2021/day05/skgsergio/plot_without_diagonals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2021/day05/skgsergio/plot_without_diagonals.png -------------------------------------------------------------------------------- /2021/day06/FORGIS98/Lanternfish.py: -------------------------------------------------------------------------------- 1 | def star(stages, days, txt): 2 | for day in range(days): 3 | first = stages.pop(0) 4 | stages.append(first if first != 0 else 0) 5 | stages[6] += first 6 | 7 | print(txt, sum(stages)) 8 | 9 | 10 | if __name__ == "__main__": 11 | with open("/home/jorge/input.txt") as file: 12 | data = list(map(int, file.read().split(','))) 13 | 14 | stages = [0, 0, 0, 0, 0, 0, 0, 0, 0] 15 | for d in data: 16 | stages[d] += 1 17 | 18 | second_star_states = stages[:] 19 | 20 | star(stages, 80, "First Star:") 21 | star(second_star_states, 256, "Second Star:") 22 | -------------------------------------------------------------------------------- /2021/day06/FORGIS98/input.txt: -------------------------------------------------------------------------------- 1 | 1,3,3,4,5,1,1,1,1,1,1,2,1,4,1,1,1,5,2,2,4,3,1,1,2,5,4,2,2,3,1,2,3,2,1,1,4,4,2,4,4,1,2,4,3,3,3,1,1,3,4,5,2,5,1,2,5,1,1,1,3,2,3,3,1,4,1,1,4,1,4,1,1,1,1,5,4,2,1,2,2,5,5,1,1,1,1,2,1,1,1,1,3,2,3,1,4,3,1,1,3,1,1,1,1,3,3,4,5,1,1,5,4,4,4,4,2,5,1,1,2,5,1,3,4,4,1,4,1,5,5,2,4,5,1,1,3,1,3,1,4,1,3,1,2,2,1,5,1,5,1,3,1,3,1,4,1,4,5,1,4,5,1,1,5,2,2,4,5,1,3,2,4,2,1,1,1,2,1,2,1,3,4,4,2,2,4,2,1,4,1,3,1,3,5,3,1,1,2,2,1,5,2,1,1,1,1,1,5,4,3,5,3,3,1,5,5,4,4,2,1,1,1,2,5,3,3,2,1,1,1,5,5,3,1,4,4,2,4,2,1,1,1,5,1,2,4,1,3,4,4,2,1,4,2,1,3,4,3,3,2,3,1,5,3,1,1,5,1,2,2,4,4,1,2,3,1,2,1,1,2,1,1,1,2,3,5,5,1,2,3,1,3,5,4,2,1,3,3,4 2 | -------------------------------------------------------------------------------- /2021/day06/casamatechs/day06.py: -------------------------------------------------------------------------------- 1 | from functools import reduce 2 | 3 | f = open('input') 4 | data = [line for line in f.readlines()] 5 | 6 | fishes = [int(f) for f in data[0].split(',')] 7 | 8 | fishes_spawn = [0] * 9 9 | 10 | for fish in fishes: 11 | fishes_spawn[fish] += 1 12 | 13 | def calc_fishes(days, fishes): 14 | for _ in range(days): 15 | fishes = fishes[1:] + fishes[:1] 16 | fishes[6] += fishes[-1] 17 | return sum(fishes) 18 | 19 | print(calc_fishes(80, fishes_spawn)) 20 | print(calc_fishes(256,fishes_spawn)) -------------------------------------------------------------------------------- /2021/day06/casamatechs/input: -------------------------------------------------------------------------------- 1 | 3,5,4,1,2,1,5,5,1,1,1,1,4,1,4,5,4,5,1,3,1,1,1,4,1,1,3,1,1,5,3,1,1,3,1,3,1,1,1,4,1,2,5,3,1,4,2,3,1,1,2,1,1,1,4,1,1,1,1,2,1,1,1,3,1,1,4,1,4,1,5,1,4,2,1,1,5,4,4,4,1,4,1,1,1,1,3,1,5,1,4,5,3,1,4,1,5,2,2,5,1,3,2,2,5,4,2,3,4,1,2,1,1,2,1,1,5,4,1,1,1,1,3,1,5,4,1,5,1,1,4,3,4,3,1,5,1,1,2,1,1,5,3,1,1,1,1,1,5,1,1,1,1,1,1,1,2,2,5,5,1,2,1,2,1,1,5,1,3,1,5,2,1,4,1,5,3,1,1,1,2,1,3,1,4,4,1,1,5,1,1,4,1,4,2,3,5,2,5,1,3,1,2,1,4,1,1,1,1,2,1,4,1,3,4,1,1,1,1,1,1,1,2,1,5,1,1,1,1,2,3,1,1,2,3,1,1,3,1,1,3,1,3,1,3,3,1,1,2,1,3,2,3,1,1,3,5,1,1,5,5,1,2,1,2,2,1,1,1,5,3,1,1,3,5,1,3,1,5,3,4,2,3,2,1,3,1,1,3,4,2,1,1,3,1,1,1,1,1,1 -------------------------------------------------------------------------------- /2021/day06/ignaciobll/input: -------------------------------------------------------------------------------- 1 | 5,1,1,3,1,1,5,1,2,1,5,2,5,1,1,1,4,1,1,5,1,1,4,1,1,1,3,5,1,1,1,1,1,1,1,1,1,4,4,4,1,1,1,1,1,4,1,1,1,1,1,5,1,1,1,4,1,1,1,1,1,3,1,1,4,1,4,1,1,2,3,1,1,1,1,4,1,2,2,1,1,1,1,1,1,3,1,1,1,1,1,2,1,1,1,1,1,1,1,4,4,1,4,2,1,1,1,1,1,4,3,1,1,1,1,2,1,1,1,2,1,1,3,1,1,1,2,1,1,1,3,1,3,1,1,1,1,1,1,1,1,1,3,1,1,1,1,3,1,1,1,1,1,1,2,1,1,2,3,1,2,1,1,4,1,1,5,3,1,1,1,2,4,1,1,2,4,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,4,3,1,2,1,2,1,5,1,2,1,1,5,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,3,1,1,5,1,1,1,1,5,1,4,1,1,1,4,1,3,4,1,4,1,1,1,1,1,1,1,1,1,3,5,1,3,1,1,1,1,4,1,5,3,1,1,1,1,1,5,1,1,1,2,2 2 | -------------------------------------------------------------------------------- /2021/day06/jasviers/input: -------------------------------------------------------------------------------- 1 | 3,3,2,1,4,1,1,2,3,1,1,2,1,2,1,1,1,1,1,1,4,1,1,5,2,1,1,2,1,1,1,3,5,1,5,5,1,1,1,1,3,1,1,3,2,1,1,1,1,1,1,4,1,1,1,1,1,1,1,4,1,3,3,1,1,3,1,3,1,2,1,3,1,1,4,1,2,4,4,5,1,1,1,1,1,1,4,1,5,1,1,5,1,1,3,3,1,3,2,5,2,4,1,4,1,2,4,5,1,1,5,1,1,1,4,1,1,5,2,1,1,5,1,1,1,5,1,1,1,1,1,3,1,5,3,2,1,1,2,2,1,2,1,1,5,1,1,4,5,1,4,3,1,1,1,1,1,1,5,1,1,1,5,2,1,1,1,5,1,1,1,4,4,2,1,1,1,1,1,1,1,3,1,1,4,4,1,4,1,1,5,3,1,1,1,5,2,2,4,2,1,1,3,1,5,5,1,1,1,4,1,5,1,1,1,4,3,3,3,1,3,1,5,1,4,2,1,1,5,1,1,1,5,5,1,1,2,1,1,1,3,1,1,1,2,3,1,2,2,3,1,3,1,1,4,1,1,2,1,1,1,1,3,5,1,1,2,1,1,1,4,1,1,1,1,1,2,4,1,1,5,3,1,1,1,2,2,2,1,5,1,3,5,3,1,1,4,1,1,4 2 | -------------------------------------------------------------------------------- /2021/day06/jasviers/main.py: -------------------------------------------------------------------------------- 1 | def lanternfish(data, days): 2 | fishes = [data.count(i) for i in range(9)] 3 | for _ in range(days): 4 | fishes[7] += fishes[0] 5 | fishes = fishes[1:] + fishes[:1] 6 | return sum(fishes) 7 | 8 | if __name__ == "__main__": 9 | 10 | with open("./input", "r") as fd: 11 | data = fd.read() 12 | 13 | data = list(map(int, data.split(","))) 14 | 15 | print("First:", lanternfish(data, 80)) 16 | print("Second:", lanternfish(data, 256)) -------------------------------------------------------------------------------- /2021/day06/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day06 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day06/jfagoagas/input: -------------------------------------------------------------------------------- 1 | 1,2,4,5,5,5,2,1,3,1,4,3,2,1,5,5,1,2,3,4,4,1,2,3,2,1,4,4,1,5,5,1,3,4,4,4,1,2,2,5,1,5,5,3,2,3,1,1,3,5,1,1,2,4,2,3,1,1,2,1,3,1,2,1,1,2,1,2,2,1,1,1,1,5,4,5,2,1,3,2,4,1,1,3,4,1,4,1,5,1,4,1,5,3,2,3,2,2,4,4,3,3,4,3,4,4,3,4,5,1,2,5,2,1,5,5,1,3,4,2,2,4,2,2,1,3,2,5,5,1,3,3,4,3,5,3,5,5,4,5,1,1,4,1,4,5,1,1,1,4,1,1,4,2,1,4,1,3,4,4,3,1,2,2,4,3,3,2,2,2,3,5,5,2,3,1,5,1,1,1,1,3,1,4,1,4,1,2,5,3,2,4,4,1,3,1,1,1,3,4,4,1,1,2,1,4,3,4,2,2,3,2,4,3,1,5,1,3,1,4,5,5,3,5,1,3,5,5,4,2,3,2,4,1,3,2,2,2,1,3,4,2,5,2,5,3,5,5,1,1,1,2,2,3,1,4,4,4,5,4,5,5,1,4,5,5,4,1,1,5,3,3,1,4,1,3,1,1,4,1,5,2,3,2,3,1,2,2,2,1,1,5,1,4,5,2,4,2,2,3 2 | -------------------------------------------------------------------------------- /2021/day06/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day06skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day06/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day06/skgsergio/input.txt: -------------------------------------------------------------------------------- 1 | 5,1,4,1,5,1,1,5,4,4,4,4,5,1,2,2,1,3,4,1,1,5,1,5,2,2,2,2,1,4,2,4,3,3,3,3,1,1,1,4,3,4,3,1,2,1,5,1,1,4,3,3,1,5,3,4,1,1,3,5,2,4,1,5,3,3,5,4,2,2,3,2,1,1,4,1,2,4,4,2,1,4,3,3,4,4,5,3,4,5,1,1,3,2,5,1,5,1,1,5,2,1,1,4,3,2,5,2,1,1,4,1,5,5,3,4,1,5,4,5,3,1,1,1,4,5,3,1,1,1,5,3,3,5,1,4,1,1,3,2,4,1,3,1,4,5,5,1,4,4,4,2,2,5,5,5,5,5,1,2,3,1,1,2,2,2,2,4,4,1,5,4,5,2,1,2,5,4,4,3,2,1,5,1,4,5,1,4,3,4,1,3,1,5,5,3,1,1,5,1,1,1,2,1,2,2,1,4,3,2,4,4,4,3,1,1,1,5,5,5,3,2,5,2,1,1,5,4,1,2,1,1,1,1,1,2,1,1,4,2,1,3,4,2,3,1,2,2,3,3,4,3,5,4,1,3,1,1,1,2,5,2,4,5,2,3,3,2,1,2,1,1,2,5,3,1,5,2,2,5,1,3,3,2,5,1,3,1,1,3,1,1,2,2,2,3,1,1,4,2 2 | -------------------------------------------------------------------------------- /2021/day07/ignaciobll/day07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2021/day07/ignaciobll/day07 -------------------------------------------------------------------------------- /2021/day07/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day07 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day07/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day07skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day07/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day08/FORGIS98/SevenSegmentSearch.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | fs::File, 3 | io::{BufRead, BufReader}, 4 | }; 5 | 6 | fn main() { 7 | let file = BufReader::new(File::open("/home/jorge/input.txt").unwrap()); 8 | 9 | let mut end: Vec = Vec::new(); 10 | 11 | for l in file.lines() { 12 | let txt = l.unwrap(); 13 | let (_, last) = txt.split_at(txt.find('|').unwrap_or(txt.len())); 14 | end.push(last.to_string().split_off(2)); 15 | } 16 | 17 | first_star(&end); 18 | } 19 | 20 | fn first_star(lines: &Vec) { 21 | let mut count: i32 = 0; 22 | 23 | for line in lines { 24 | for l in line.split(' ') { 25 | if l.len() == 7 || l.len() < 5 { 26 | count += 1; 27 | } 28 | } 29 | } 30 | 31 | println!("First Star: {}", count); 32 | } -------------------------------------------------------------------------------- /2021/day08/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day08 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day08/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day08skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day08/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day09/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day09skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day09/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day09/skgsergio/plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2021/day09/skgsergio/plot.png -------------------------------------------------------------------------------- /2021/day10/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day10 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day10/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day10skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day10/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day11/FORGIS98/input.txt: -------------------------------------------------------------------------------- 1 | 2138862165 2 | 2726378448 3 | 3235172758 4 | 6281242643 5 | 4256223158 6 | 1112268142 7 | 1162836182 8 | 1543525861 9 | 1882656326 10 | 8844263151 11 | -------------------------------------------------------------------------------- /2021/day11/casamatechs/input: -------------------------------------------------------------------------------- 1 | 4112256372 2 | 3143253712 3 | 4516848631 4 | 3783477137 5 | 3746723582 6 | 5861358884 7 | 4843351774 8 | 2316447621 9 | 6643817745 10 | 6366815868 11 | -------------------------------------------------------------------------------- /2021/day11/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day11 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day11/jfagoagas/input: -------------------------------------------------------------------------------- 1 | 6617113584 2 | 6544218638 3 | 5457331488 4 | 1135675587 5 | 1221353216 6 | 1811124378 7 | 1387864368 8 | 4427637262 9 | 6778645486 10 | 3682146745 11 | -------------------------------------------------------------------------------- /2021/day11/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day11skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day11/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day11/skgsergio/input.txt: -------------------------------------------------------------------------------- 1 | 2138862165 2 | 2726378448 3 | 3235172758 4 | 6281242643 5 | 4256223158 6 | 1112268142 7 | 1162836182 8 | 1543525861 9 | 1882656326 10 | 8844263151 11 | -------------------------------------------------------------------------------- /2021/day12/casamatechs/input: -------------------------------------------------------------------------------- 1 | start-qs 2 | qs-jz 3 | start-lm 4 | qb-QV 5 | QV-dr 6 | QV-end 7 | ni-qb 8 | VH-jz 9 | qs-lm 10 | qb-end 11 | dr-fu 12 | jz-lm 13 | start-VH 14 | QV-jz 15 | VH-qs 16 | lm-dr 17 | dr-ni 18 | ni-jz 19 | lm-QV 20 | jz-dr 21 | ni-end 22 | VH-dr 23 | VH-ni 24 | qb-HE -------------------------------------------------------------------------------- /2021/day12/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day12skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day12/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day12/skgsergio/input.txt: -------------------------------------------------------------------------------- 1 | qi-UD 2 | jt-br 3 | wb-TF 4 | VO-aa 5 | UD-aa 6 | br-end 7 | end-HA 8 | qi-br 9 | br-HA 10 | UD-start 11 | TF-qi 12 | br-hf 13 | VO-hf 14 | start-qi 15 | end-aa 16 | hf-HA 17 | hf-UD 18 | aa-hf 19 | TF-hf 20 | VO-start 21 | wb-aa 22 | UD-wb 23 | KX-wb 24 | qi-VO 25 | br-TF 26 | -------------------------------------------------------------------------------- /2021/day13/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day13 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day13/jfagoagas/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2021/day13/jfagoagas/go.sum -------------------------------------------------------------------------------- /2021/day13/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day13skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day13/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day14/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day14skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day14/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day15/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day15skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day15/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day16/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day16 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day16/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day16skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day16/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day17/casamatechs/input: -------------------------------------------------------------------------------- 1 | target area: x=155..215, y=-132..-72 -------------------------------------------------------------------------------- /2021/day17/skgsergio/example: -------------------------------------------------------------------------------- 1 | target area: x=20..30, y=-10..-5 2 | 3 | -------------------------------------------------------------------------------- /2021/day17/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day17skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day17/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day17/skgsergio/input.txt: -------------------------------------------------------------------------------- 1 | target area: x=150..171, y=-129..-70 2 | -------------------------------------------------------------------------------- /2021/day18/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day18skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day18/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day19/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day19skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day19/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day20/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day20 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day20/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day20skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day20/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day21/casamatechs/input: -------------------------------------------------------------------------------- 1 | Player 1 starting position: 10 2 | Player 2 starting position: 1 -------------------------------------------------------------------------------- /2021/day21/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day21 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day21/jfagoagas/input: -------------------------------------------------------------------------------- 1 | Player 1 starting position: 9 2 | Player 2 starting position: 3 3 | -------------------------------------------------------------------------------- /2021/day21/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day21skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day21/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day21/skgsergio/input.txt: -------------------------------------------------------------------------------- 1 | Player 1 starting position: 10 2 | Player 2 starting position: 8 3 | -------------------------------------------------------------------------------- /2021/day22/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day22skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day22/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day23/casamatechs/input: -------------------------------------------------------------------------------- 1 | ############# 2 | #...........# 3 | ###D#A#A#D### 4 | #D#C#B#A# 5 | #D#B#A#C# 6 | #C#C#B#B# 7 | ######### -------------------------------------------------------------------------------- /2021/day24/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day24skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day24/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2021/day25/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module day25 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /2021/day25/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc21day25skgsergio 2 | 3 | go 1.17 4 | 5 | require github.com/pkg/profile v1.6.0 6 | -------------------------------------------------------------------------------- /2021/day25/skgsergio/go.sum: -------------------------------------------------------------------------------- 1 | github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= 2 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 3 | -------------------------------------------------------------------------------- /2022/andsanmar/README.md: -------------------------------------------------------------------------------- 1 | # How to run 2 | 3 | `cargo run --bin day01 inputs/day01` 4 | -------------------------------------------------------------------------------- /2022/andsanmar/src/day01.rs: -------------------------------------------------------------------------------- 1 | fn star1(l : &Vec>) { 2 | println!("{:?}", l.iter().map(|s| s.iter().sum::()).max()); 3 | } 4 | 5 | fn star2(l : &Vec>) { 6 | let mut set : Vec = l.iter().map(|s| s.iter().sum::()).collect(); 7 | set.sort_by(|a,b| b.cmp(a)); 8 | println!("{:?}", set.iter().take(3).sum::()); 9 | } 10 | 11 | fn main() { 12 | let args: Vec = std::env::args().collect(); 13 | if args.len() < 2 { 14 | eprintln!("Feed me with the input!"); 15 | std::process::exit(1); 16 | }; 17 | let l : Vec> = std::fs::read_to_string(args[1].clone()).unwrap().split("\n\n").map(|s| s.lines().filter_map(|l| match l.parse() { 18 | Ok(n) => Some(n), 19 | _ => None 20 | }).collect()).collect(); 21 | 22 | star1(&l); 23 | star2(&l); 24 | } 25 | -------------------------------------------------------------------------------- /2022/andsanmar/src/day06.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashSet; 2 | 3 | type Struct = Vec; 4 | 5 | fn star(l : &Struct, j : usize) { 6 | let n = (j..l.len()).filter(|i| { 7 | let a : HashSet<&char> = l[i-j..*i].iter().collect(); 8 | a.len() == j 9 | }).next(); 10 | println!("{:?}", n.unwrap()); 11 | } 12 | 13 | fn main() { 14 | let args: Vec = std::env::args().collect(); 15 | if args.len() < 2 { 16 | eprintln!("Feed me with the input!"); 17 | std::process::exit(1); 18 | }; 19 | let l : Struct = std::fs::read_to_string(args[1].clone()).unwrap().lines().filter_map(|l| { 20 | if !l.is_empty() { 21 | Some(l.chars()) 22 | } 23 | else { None } 24 | }).flatten().collect(); 25 | 26 | star(&l, 4); 27 | star(&l, 14); 28 | } 29 | -------------------------------------------------------------------------------- /2022/day01/aafrecct/main.nim: -------------------------------------------------------------------------------- 1 | from std/strutils import parseInt 2 | from std/math import sum 3 | 4 | proc push[I, T](arr: ref array[I, T], i: I, elem: T) = 5 | if i < arr[].len - 1: 6 | push(arr, i + 1, arr[i]) 7 | arr[i] = elem 8 | 9 | proc main(): ref array[0..2, int] = 10 | var elf_total: int = 0 11 | result = new array[0..2, int] 12 | result[] = [0, 0, 0] 13 | for line in lines "input": 14 | if line.len > 0: 15 | elf_total += parseInt(line) 16 | else: 17 | for i, elf in result[].pairs(): 18 | if elf_total > elf: 19 | result.push(i, elf_total) 20 | break 21 | elf_total = 0 22 | return result 23 | 24 | let solution = main() 25 | echo solution[], " ", sum(solution[]) 26 | 27 | -------------------------------------------------------------------------------- /2022/day01/cuwano/Makefile: -------------------------------------------------------------------------------- 1 | try1: 2 | mix run -e "Cuwano.test(1)" 3 | 4 | solve1: 5 | mix run -e "Cuwano.solve(1)" 6 | 7 | try2: 8 | mix run -e "Cuwano.test(2)" 9 | 10 | solve2: 11 | mix run -e "Cuwano.solve(2)" 12 | -------------------------------------------------------------------------------- /2022/day01/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2022/day01/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.14", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | {:aoc, github: "Ironjanowar/aoc", branch: "master"} 25 | ] 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /2022/day01/cuwano/mix.lock: -------------------------------------------------------------------------------- 1 | %{ 2 | "aoc": {:git, "https://github.com/Ironjanowar/aoc.git", "a0aa1a90ecc0f4a350916ff2f81def2bbb83a2de", [branch: "master"]}, 3 | } 4 | -------------------------------------------------------------------------------- /2022/day01/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2022/day01/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2022/day01/cuwano/test_input: -------------------------------------------------------------------------------- 1 | 1000 2 | 2000 3 | 3000 4 | 5 | 4000 6 | 7 | 5000 8 | 6000 9 | 10 | 7000 11 | 8000 12 | 9000 13 | 14 | 10000 -------------------------------------------------------------------------------- /2022/day01/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day01 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day01/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | 1000 2 | 2000 3 | 3000 4 | 5 | 4000 6 | 7 | 5000 8 | 6000 9 | 10 | 7000 11 | 8000 12 | 9000 13 | 14 | 10000 -------------------------------------------------------------------------------- /2022/day01/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day01skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day02/aafrecct/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2022/day02/aafrecct/main -------------------------------------------------------------------------------- /2022/day02/cuwano/Makefile: -------------------------------------------------------------------------------- 1 | try1: 2 | mix run -e "Cuwano.test(1)" 3 | 4 | solve1: 5 | mix run -e "Cuwano.solve(1)" 6 | 7 | try2: 8 | mix run -e "Cuwano.test(2)" 9 | 10 | solve2: 11 | mix run -e "Cuwano.solve(2)" 12 | -------------------------------------------------------------------------------- /2022/day02/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2022/day02/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.14", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2022/day02/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2022/day02/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2022/day02/cuwano/test_input: -------------------------------------------------------------------------------- 1 | A Y 2 | B X 3 | C Z -------------------------------------------------------------------------------- /2022/day02/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day02 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day02/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | A Y 2 | B X 3 | C Z -------------------------------------------------------------------------------- /2022/day02/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day02skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day03/cuwano/Makefile: -------------------------------------------------------------------------------- 1 | try1: 2 | mix run -e "Cuwano.test(1)" 3 | 4 | solve1: 5 | mix run -e "Cuwano.solve(1)" 6 | 7 | try2: 8 | mix run -e "Cuwano.test(2)" 9 | 10 | solve2: 11 | mix run -e "Cuwano.solve(2)" 12 | -------------------------------------------------------------------------------- /2022/day03/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2022/day03/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.14", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2022/day03/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2022/day03/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2022/day03/cuwano/test_input: -------------------------------------------------------------------------------- 1 | vJrwpWtwJgWrhcsFMMfFFhFp 2 | jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL 3 | PmmdzqPrVvPwwTWBwg 4 | wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn 5 | ttgJtRGJQctTZtZT 6 | CrZsJsPPZsGzwwsLwLmpwMDw -------------------------------------------------------------------------------- /2022/day03/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day03 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day03/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | vJrwpWtwJgWrhcsFMMfFFhFp 2 | jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL 3 | PmmdzqPrVvPwwTWBwg 4 | wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn 5 | ttgJtRGJQctTZtZT 6 | CrZsJsPPZsGzwwsLwLmpwMDw -------------------------------------------------------------------------------- /2022/day03/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day03skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day04/aafrecct/main.nim: -------------------------------------------------------------------------------- 1 | from std/strutils import parse_int, split 2 | from std/sugar import collect 3 | 4 | proc `in`(a, b: seq[int]): bool = 5 | (a[0] >= b[0]) and (a[1] <= b[1]) 6 | 7 | proc overlap(a, b: seq[int]): bool = 8 | (a[0] <= b[0] and b[0] <= a[1]) or 9 | (a[0] <= b[1] and b[1] <= a[1]) or 10 | (b[0] <= a[0] and a[0] <= b[1]) or 11 | (b[0] <= a[1] and a[1] <= b[1]) 12 | 13 | proc main(): array[0..1, int] = 14 | result = [0, 0] 15 | for line in lines "input": 16 | let 17 | tasks = line.split(",") 18 | task1 = collect: 19 | for task in tasks[0].split("-"): parse_int(task) 20 | task2 = collect: 21 | for task in tasks[1].split("-"): parse_int(task) 22 | result[0] += int(task1 in task2 or task2 in task1) 23 | result[1] += int(overlap(task1, task2)) 24 | 25 | echo main() 26 | -------------------------------------------------------------------------------- /2022/day04/cuwano/Makefile: -------------------------------------------------------------------------------- 1 | try1: 2 | mix run -e "Cuwano.test(1)" 3 | 4 | solve1: 5 | mix run -e "Cuwano.solve(1)" 6 | 7 | try2: 8 | mix run -e "Cuwano.test(2)" 9 | 10 | solve2: 11 | mix run -e "Cuwano.solve(2)" 12 | -------------------------------------------------------------------------------- /2022/day04/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2022/day04/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.14", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2022/day04/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2022/day04/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2022/day04/cuwano/test_input: -------------------------------------------------------------------------------- 1 | 2-4,6-8 2 | 2-3,4-5 3 | 5-7,7-9 4 | 2-8,3-7 5 | 6-6,4-6 6 | 2-6,4-8 -------------------------------------------------------------------------------- /2022/day04/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day04 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day04/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | 2-4,6-8 2 | 2-3,4-5 3 | 5-7,7-9 4 | 2-8,3-7 5 | 6-6,4-6 6 | 2-6,4-8 -------------------------------------------------------------------------------- /2022/day04/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day04skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day05/cuwano/Makefile: -------------------------------------------------------------------------------- 1 | try1: 2 | mix run -e "Cuwano.test(1)" 3 | 4 | solve1: 5 | mix run -e "Cuwano.solve(1)" 6 | 7 | try2: 8 | mix run -e "Cuwano.test(2)" 9 | 10 | solve2: 11 | mix run -e "Cuwano.solve(2)" 12 | -------------------------------------------------------------------------------- /2022/day05/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2022/day05/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.14", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2022/day05/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2022/day05/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2022/day05/cuwano/test_input: -------------------------------------------------------------------------------- 1 | [D] 2 | [N] [C] 3 | [Z] [M] [P] 4 | 1 2 3 5 | 6 | move 1 from 2 to 1 7 | move 3 from 1 to 3 8 | move 2 from 2 to 1 9 | move 1 from 1 to 2 -------------------------------------------------------------------------------- /2022/day05/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day05 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day05/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | [D] 2 | [N] [C] 3 | [Z] [M] [P] 4 | 1 2 3 5 | 6 | move 1 from 2 to 1 7 | move 3 from 1 to 3 8 | move 2 from 2 to 1 9 | move 1 from 1 to 2 -------------------------------------------------------------------------------- /2022/day05/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day05skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day06/aafrecct/main.nim: -------------------------------------------------------------------------------- 1 | proc all_different_chars(str: string): bool = 2 | var count = 0 3 | for c in str: 4 | for c2 in str: 5 | count += int(c == c2) 6 | return count == len(str) 7 | 8 | proc first_marker(str: string, length: int): int = 9 | for i in 0..str.len - length: 10 | echo str[i..i + length - 1] 11 | if all_different_chars(str[i..i + length - 1]): 12 | return i + length 13 | return -1 14 | 15 | proc main(): array[0..1, int] = 16 | result = [0, 0] 17 | for line in lines "input": 18 | result[0] = first_marker(line, 4) 19 | result[1] = first_marker(line, 14) 20 | return result 21 | 22 | echo main() 23 | -------------------------------------------------------------------------------- /2022/day06/cuwano/Makefile: -------------------------------------------------------------------------------- 1 | try1: 2 | mix run -e "Cuwano.test(1)" 3 | 4 | solve1: 5 | mix run -e "Cuwano.solve(1)" 6 | 7 | try2: 8 | mix run -e "Cuwano.test(2)" 9 | 10 | solve2: 11 | mix run -e "Cuwano.solve(2)" 12 | -------------------------------------------------------------------------------- /2022/day06/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2022/day06/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.14", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2022/day06/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2022/day06/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2022/day06/cuwano/test_input: -------------------------------------------------------------------------------- 1 | bvwbjplbgvbhsrlpgdmjqwftvncz -------------------------------------------------------------------------------- /2022/day06/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day06 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day06/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | mjqjpqmgbljsphdztnvjfqwrcgsmlb 2 | bvwbjplbgvbhsrlpgdmjqwftvncz 3 | nppdvjthqldpwncqszvftbrmjlhg 4 | nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg 5 | zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw -------------------------------------------------------------------------------- /2022/day06/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day06skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day07/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day07 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day07/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | $ cd / 2 | $ ls 3 | dir a 4 | 14848514 b.txt 5 | 8504156 c.dat 6 | dir d 7 | $ cd a 8 | $ ls 9 | dir e 10 | 29116 f 11 | 2557 g 12 | 62596 h.lst 13 | $ cd e 14 | $ ls 15 | 584 i 16 | $ cd .. 17 | $ cd .. 18 | $ cd d 19 | $ ls 20 | 4060174 j 21 | 8033020 d.log 22 | 5626152 d.ext 23 | 7214296 k -------------------------------------------------------------------------------- /2022/day07/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day07skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day08/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day08 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day08/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | 30373 2 | 25512 3 | 65332 4 | 33549 5 | 35390 -------------------------------------------------------------------------------- /2022/day08/skgsergio/combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2022/day08/skgsergio/combined.png -------------------------------------------------------------------------------- /2022/day08/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day08skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day08/skgsergio/patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2022/day08/skgsergio/patch.png -------------------------------------------------------------------------------- /2022/day08/skgsergio/visible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2022/day08/skgsergio/visible.png -------------------------------------------------------------------------------- /2022/day09/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day09 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day09/jfagoagas/input_test.txt: -------------------------------------------------------------------------------- 1 | R 4 2 | U 4 3 | L 3 4 | D 1 5 | R 4 6 | D 1 7 | L 5 8 | R 2 -------------------------------------------------------------------------------- /2022/day09/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day09skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day10/jfagoagas/go.mod: -------------------------------------------------------------------------------- 1 | module jfagoagasaoc2022day10 2 | 3 | go 1.19 4 | -------------------------------------------------------------------------------- /2022/day10/jfagoagas/input_test_1.txt: -------------------------------------------------------------------------------- 1 | noop 2 | addx 3 3 | addx -5 -------------------------------------------------------------------------------- /2022/day10/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day10skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day11/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day11skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day12/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day12skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day13/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day13skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day14/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day14skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day15/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day15skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day16/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day16skgsergio 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/pkg/profile v1.7.0 7 | golang.org/x/sync v0.1.0 8 | ) 9 | 10 | require ( 11 | github.com/felixge/fgprof v0.9.3 // indirect 12 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 13 | ) 14 | -------------------------------------------------------------------------------- /2022/day17/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day17skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day18/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day18skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day19/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day19skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day20/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day20skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day21/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day21skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2022/day23/skgsergio/go.mod: -------------------------------------------------------------------------------- 1 | module aoc22day23skgsergio 2 | 3 | go 1.19 4 | 5 | require github.com/pkg/profile v1.7.0 6 | 7 | require ( 8 | github.com/felixge/fgprof v0.9.3 // indirect 9 | github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /2023/day01/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2023/day01/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.15", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2023/day01/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2023/day01/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2023/day01/cuwano/test_input: -------------------------------------------------------------------------------- 1 | two1nine 2 | eightwothree 3 | abcone2threexyz 4 | xtwone3four 5 | 4nineeightseven2 6 | zoneight234 7 | 7pqrstsixteen -------------------------------------------------------------------------------- /2023/day02/cuwano/README.md: -------------------------------------------------------------------------------- 1 | # Cuwano 2 | 3 | **TODO: Add description** 4 | 5 | ## Installation 6 | 7 | If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 | by adding `cuwano` to your list of dependencies in `mix.exs`: 9 | 10 | ```elixir 11 | def deps do 12 | [ 13 | {:cuwano, "~> 0.1.0"} 14 | ] 15 | end 16 | ``` 17 | 18 | Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 | and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 | be found at . 21 | 22 | -------------------------------------------------------------------------------- /2023/day02/cuwano/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Cuwano.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :cuwano, 7 | version: "0.1.0", 8 | elixir: "~> 1.15", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | # Run "mix help compile.app" to learn about applications. 15 | def application do 16 | [ 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | # Run "mix help deps" to learn about dependencies. 22 | defp deps do 23 | [ 24 | # {:dep_from_hexpm, "~> 0.3.0"}, 25 | # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} 26 | ] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /2023/day02/cuwano/test/cuwano_test.exs: -------------------------------------------------------------------------------- 1 | defmodule CuwanoTest do 2 | use ExUnit.Case 3 | doctest Cuwano 4 | 5 | test "greets the world" do 6 | assert Cuwano.hello() == :world 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /2023/day02/cuwano/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /2023/day02/cuwano/test_input: -------------------------------------------------------------------------------- 1 | Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green 2 | Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue 3 | Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red 4 | Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red 5 | Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green -------------------------------------------------------------------------------- /2024/day01/devcexx/.projectile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acmfi/AdventCode/5bc0afd4530a4e2cb682096c21df96e363998455/2024/day01/devcexx/.projectile -------------------------------------------------------------------------------- /2024/day01/devcexx/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "day01" 7 | version = "0.1.0" 8 | dependencies = [ 9 | "itertools", 10 | ] 11 | 12 | [[package]] 13 | name = "either" 14 | version = "1.13.0" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" 17 | 18 | [[package]] 19 | name = "itertools" 20 | version = "0.13.0" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" 23 | dependencies = [ 24 | "either", 25 | ] 26 | -------------------------------------------------------------------------------- /2024/day01/devcexx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day01" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [[bin]] 7 | name = "day01" 8 | path = "./main.rs" 9 | 10 | [dependencies] 11 | itertools = "0.13.0" 12 | -------------------------------------------------------------------------------- /2024/day01/ignaciobll/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1733015953, 6 | "narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=", 7 | "owner": "nixos", 8 | "repo": "nixpkgs", 9 | "rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "nixos", 14 | "ref": "nixos-unstable", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /2024/day02/devcexx/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "day02" 7 | version = "0.1.0" 8 | dependencies = [ 9 | "itertools", 10 | ] 11 | 12 | [[package]] 13 | name = "either" 14 | version = "1.13.0" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" 17 | 18 | [[package]] 19 | name = "itertools" 20 | version = "0.13.0" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" 23 | dependencies = [ 24 | "either", 25 | ] 26 | -------------------------------------------------------------------------------- /2024/day02/devcexx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day02" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [[bin]] 7 | name = "day02" 8 | path = "./main.rs" 9 | 10 | [dependencies] 11 | itertools = "0.13.0" 12 | -------------------------------------------------------------------------------- /2024/day03/devcexx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day03" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [[bin]] 7 | name = "day03" 8 | path = "./main.rs" 9 | 10 | [dependencies] 11 | regex = "1.11.1" 12 | -------------------------------------------------------------------------------- /2024/day04/devcexx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day04" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [[bin]] 7 | name = "day04" 8 | path = "./main.rs" 9 | 10 | [dependencies] 11 | ndarray = "0.16.1" 12 | --------------------------------------------------------------------------------