diff --git a/src/main/java/de/advent_of_code_2025/one/Main.java b/src/main/java/de/advent_of_code_2025/day1/Main.java similarity index 99% rename from src/main/java/de/advent_of_code_2025/one/Main.java rename to src/main/java/de/advent_of_code_2025/day1/Main.java index 8450c5b..91d0aa6 100644 --- a/src/main/java/de/advent_of_code_2025/one/Main.java +++ b/src/main/java/de/advent_of_code_2025/day1/Main.java @@ -1,4 +1,4 @@ -package de.advent_of_code_2025.one; +package de.advent_of_code_2025.day1; import de.advent_of_code_2025.util.InputReader; diff --git a/src/main/java/de/advent_of_code_2025/two/Main.java b/src/main/java/de/advent_of_code_2025/day2/Main.java similarity index 98% rename from src/main/java/de/advent_of_code_2025/two/Main.java rename to src/main/java/de/advent_of_code_2025/day2/Main.java index 197e299..d15be84 100644 --- a/src/main/java/de/advent_of_code_2025/two/Main.java +++ b/src/main/java/de/advent_of_code_2025/day2/Main.java @@ -1,4 +1,4 @@ -package de.advent_of_code_2025.two; +package de.advent_of_code_2025.day2; import de.advent_of_code_2025.util.InputMangler; import de.advent_of_code_2025.util.InputReader; diff --git a/src/main/java/de/advent_of_code_2025/day3/Main.java b/src/main/java/de/advent_of_code_2025/day3/Main.java new file mode 100644 index 0000000..d2be1fd --- /dev/null +++ b/src/main/java/de/advent_of_code_2025/day3/Main.java @@ -0,0 +1,118 @@ +package de.advent_of_code_2025.day3; + +import de.advent_of_code_2025.util.InputReader; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class Main { + + private static final record Bank(String bankNumbers) { + public long findMaxJoltage() { + long max = 0; + int index = 0; + + for(int i = 0; i < bankNumbers.length(); i++) { + long current = bankNumbers.charAt(i); + + if(max == 0) { + max = current; + index = i; + + continue; + } + + if(current > max && i != bankNumbers.length() - 1) { // taking the very last max does not make sense as no second digit after that + max = current; + index = i; + } + } + + max = 0; + int secondIndex = 0; + + for(int i = index + 1; i < bankNumbers.length(); i++) { + long current = bankNumbers.charAt(i); + + if(max == 0) { + max = current; + secondIndex = i; + + continue; + } + + if(current > max) { + max = current; + secondIndex = i; + } + } + + return Long.parseLong(bankNumbers.charAt(index) + "" + bankNumbers.charAt(secondIndex)); + } + + public long findMaxJoltageOverride() { + final List chars = new ArrayList<>(12); + + long max = 0; + int index = 0; + + for(int i = 0; i < bankNumbers.length() - 12; i++) { + long current = bankNumbers.charAt(i); + + if(max == 0) { + max = current; + index = i; + + continue; + } + + if(current > max && i != bankNumbers.length() - 1) { // taking the very last max does not make sense as no second digit after that + max = current; + index = i; + } + } + + chars.add(bankNumbers.charAt(index)); + + return toLong(chars); + } + + private static final long toLong(List chars) { + final StringBuilder sb = new StringBuilder(); + + for(Character c : chars) { + sb.append(c); + } + + return Long.parseLong(sb.toString()); + } + } + + public static void main(String[] args) throws Throwable { + final List lines = InputReader.read(args); + final List banks = setupBanks(lines); + long joltageSum = 0; + long joltageOverrideSum = 0; + + // Part 1 + + for(Bank b : banks) { + joltageSum += b.findMaxJoltage(); + } + + System.out.println(joltageSum); + + // Part 2 + + for(Bank b : banks) { + joltageOverrideSum += b.findMaxJoltageOverride(); + } + + System.out.println(joltageOverrideSum); + } + + private static final List setupBanks(List lines) { + return lines.stream().map(Bank::new).collect(Collectors.toList()); + } +} diff --git a/src/main/java/de/advent_of_code_2025/day4/Main.java b/src/main/java/de/advent_of_code_2025/day4/Main.java new file mode 100644 index 0000000..8a621ff --- /dev/null +++ b/src/main/java/de/advent_of_code_2025/day4/Main.java @@ -0,0 +1,254 @@ +package de.advent_of_code_2025.day4; + +import de.advent_of_code_2025.util.InputReader; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class Main { + private static final class Cell { + private boolean free; + private Cell previous; + private Cell next; + private Cell above; + private Cell below; + private Cell diagonalLeftUp; + private Cell diagonalLeftDown; + private Cell diagonalRightUp; + private Cell diagonalRightDown; + + Cell(boolean free) { + this.free = free; + } + + void setPrevious(Cell previous) { + this.previous = previous; + } + + void setNext(Cell next) { + this.next = next; + } + + void setAbove(Cell above) { + this.above = above; + } + + void setBelow(Cell below) { + this.below = below; + } + + void setDiagonalLeftUp(Cell diagonalLeftUp) { + this.diagonalLeftUp = diagonalLeftUp; + } + + void setDiagonalLeftDown(Cell diagonalLeftDown) { + this.diagonalLeftDown = diagonalLeftDown; + } + + void setDiagonalRightUp(Cell diagonalRightUp) { + this.diagonalRightUp = diagonalRightUp; + } + + void setDiagonalRightDown(Cell diagonalRightDown) { + this.diagonalRightDown = diagonalRightDown; + } + + boolean isFree() { + return this.free; + } + + void remove() { + this.free = true; + } + + boolean isMovable() { + if(this.free) { + return false; + } + + int adjacentCellsUsed = 0; + + adjacentCellsUsed += adjacentCell(this.diagonalLeftUp); + adjacentCellsUsed += adjacentCell(this.above); + adjacentCellsUsed += adjacentCell(this.diagonalRightUp); + adjacentCellsUsed += adjacentCell(this.previous); + adjacentCellsUsed += adjacentCell(this.next); + adjacentCellsUsed += adjacentCell(this.diagonalLeftDown); + adjacentCellsUsed += adjacentCell(this.below); + adjacentCellsUsed += adjacentCell(this.diagonalRightDown); + + return adjacentCellsUsed < 4; + } + + private static int adjacentCell(Cell adjacentCell) { + return adjacentCell != null ? adjacentCell.isFree() ? 0 : 1 : 0; + } + } + + private static final class Row { + private final List cells; + private Row previous; + private Row next; + + Row(List cells) { + this.cells = cells; + } + + void setPrevious(Row previous) { + this.previous = previous; + } + + void setNext(Row next) { + this.next = next; + } + + List getCells() { + return this.cells; + } + + int countMovableCells() { + int retVal = 0; + + for(Cell cell : cells) { + retVal += cell.isMovable() ? 1 : 0; + } + + return retVal; + } + + int countAndRemoveCells() { + int retVal = 0; + + for(Cell cell : cells) { + if(cell.isMovable()) { + retVal += 1; + cell.remove(); + } + } + + return retVal; + } + } + + private static final record Grid(List rows) { + int countMovableCells() { + int retVal = 0; + + for (Row row : rows) { + retVal += row.countMovableCells(); + } + + return retVal; + } + + int countAndRemoveCells() { + int retVal = 0; + + for (Row row : rows) { + retVal += row.countAndRemoveCells(); + } + + return retVal; + } + } + + public static void main(String[] args) throws Throwable { + final List lines = InputReader.read(args); + final Grid grid = setupGrid(lines); + + // Part 1 + + System.out.println(grid.countMovableCells()); + + // Part 2 + + int removed = 0; + int lastRemoved = 0; + + do { + lastRemoved = grid.countAndRemoveCells(); + removed += lastRemoved; + } while(lastRemoved != 0); + + System.out.println(removed); + } + + private static Grid setupGrid(List lines) { + final List rows = new ArrayList<>(); + + for(String line : lines) { + final List cells = line.chars().mapToObj(c -> new Cell(c == '.')).toList(); + + for(int i = 0; i < cells.size(); i++) { + if(i == 0) { + cells.get(i).setNext(cells.get(i + 1)); + // no previous + } + else if(i == cells.size() - 1) { + // no next + cells.get(i).setPrevious(cells.get(i - 1)); + } + else { + cells.get(i).setNext(cells.get(i + 1)); + cells.get(i).setPrevious(cells.get(i - 1)); + } + } + + rows.add(new Row(cells)); + } + + for(int i = 0; i < rows.size(); i++) { + final Row current = rows.get(i); + final Optional previous; + final Optional next; + + if(i == 0) { + previous = Optional.empty(); + next = Optional.of(rows.get(i + 1)); + current.setNext(rows.get(i + 1)); + } + else if(i == rows.size() - 1) { + previous = Optional.of(rows.get(i - 1)); + next = Optional.empty(); + current.setPrevious(rows.get(i - 1)); + } + else { + previous = Optional.of(rows.get(i - 1)); + next = Optional.of(rows.get(i + 1)); + current.setNext(rows.get(i + 1)); + current.setPrevious(rows.get(i - 1)); + } + + for(int j = 0; j < rows.get(i).getCells().size(); j++) { + final Cell currentCell = rows.get(i).getCells().get(j); + + if(next.isPresent()) { + currentCell.setBelow(next.get().getCells().get(j)); + + if(j != 0) { + currentCell.setDiagonalLeftDown(next.get().getCells().get(j - 1)); + } + + if(j != rows.get(i).getCells().size() - 1) { + currentCell.setDiagonalRightDown(next.get().getCells().get(j + 1)); + } + } + + if(previous.isPresent()) { + currentCell.setAbove(previous.get().getCells().get(j)); + + if(j != 0) { + currentCell.setDiagonalLeftUp(previous.get().getCells().get(j - 1)); + } + + if(j != rows.get(i).getCells().size() - 1) { + currentCell.setDiagonalRightUp(previous.get().getCells().get(j + 1)); + } + } + } + } + + return new Grid(rows); + } +} diff --git a/src/main/java/de/advent_of_code_2025/five/Main.java b/src/main/java/de/advent_of_code_2025/day5/Main.java similarity index 99% rename from src/main/java/de/advent_of_code_2025/five/Main.java rename to src/main/java/de/advent_of_code_2025/day5/Main.java index 3adcb78..bdea5ed 100644 --- a/src/main/java/de/advent_of_code_2025/five/Main.java +++ b/src/main/java/de/advent_of_code_2025/day5/Main.java @@ -1,4 +1,4 @@ -package de.advent_of_code_2025.five; +package de.advent_of_code_2025.day5; import de.advent_of_code_2025.util.InputMangler; import de.advent_of_code_2025.util.InputReader; diff --git a/src/main/resources/one/input.txt b/src/main/resources/day1/input.txt similarity index 100% rename from src/main/resources/one/input.txt rename to src/main/resources/day1/input.txt diff --git a/src/main/resources/one/input_example.txt b/src/main/resources/day1/input_example.txt similarity index 100% rename from src/main/resources/one/input_example.txt rename to src/main/resources/day1/input_example.txt diff --git a/src/main/resources/two/input.txt b/src/main/resources/day2/input.txt similarity index 100% rename from src/main/resources/two/input.txt rename to src/main/resources/day2/input.txt diff --git a/src/main/resources/two/input_example.txt b/src/main/resources/day2/input_example.txt similarity index 100% rename from src/main/resources/two/input_example.txt rename to src/main/resources/day2/input_example.txt diff --git a/src/main/resources/day3/input.txt b/src/main/resources/day3/input.txt new file mode 100644 index 0000000..0dc5cab --- /dev/null +++ b/src/main/resources/day3/input.txt @@ -0,0 +1,200 @@ +5322532524412431424224553433255235332456444432543425324265123263732352855273513551554412243351423435 +2222222322121523223222213232233421252123126222322231213332212224251322442212422523422123222524243222 +2222322222122222222222241221221133222211222122122217211221222123222252222231322222122222131122211122 +4555222333157232223313251623442333344622315323382328162125242333245222364315243343275358782723732334 +3755585773743357637765947644769378868882666756965363498968537896774663768589847975888788655683837677 +4316244322224272244245426322222212222212244212212223421228232247343452823923632412433742954323322242 +3123437773557466673436763336546644743763954743383735436585345456416164343656464563326466336657664337 +3222121222122822322532422231234512242123232222222123212122121322532221234224232331222223122212222222 +3543144436431542514442254233623253346462616656235335615563323544526342646245433445435545362453442334 +2547146634424442264255256553333251363643343749392814222633657546436246445244123432332163453252346654 +8665217833674358346667678288372672886376381315333847466233267558638338453273788835373884385871453388 +2813223323222222332222322332223211322221231323312356212222133233222223323232234222232113213342222322 +2261232115224321353654614525546264254634544934433223246564544455624365437643342124281424566545453386 +3523353336456373315333436233333335232333732343335433562322563333522235325212523333363314232443263643 +2314342234111113133311211432343132211444241411312124123312331141344443331243134443442112314242456789 +4353274144444287398983647445438678793767694364466552469357365921634986377848424726873285333545845731 +2432365333234322323432364633422244334327432633342462454532254233232331324343333216367223235335322123 +2323334335323325443335223323433322423333254243333123232324323432323133226413233313332332313432323273 +4233233446424366833333332443333337334455644244342234344442343333433433239345424213332324332374333362 +3333333323333335242333333335635233233333233333223333343335333353433133213252231534338341263533317333 +5384467582246472644667557756736226252375978356526218277574624473866633725366642445262666647363721663 +2322375425534432355134237553315353243324333333392433343231343255223343333524543763353733333335326335 +2522212221222142522212235252323125121222222724224212332321325222222222225222221122224234522212112212 +2323232222242212223233122222212322225242332423242222222211222223222222222222222232112212232222222253 +2525228222225166324572224321154343235122325222142424523432412315655422222342554552325614222325212322 +2221222112621332222222322422222122221212131244122211112222222312322322232222212223212221223222212232 +6466665669645464226256457666556465672536455544356665362555637454646552643755455566546541658654554536 +6444746647444543553443364436564474472443673446443347384344345645444745374734274447548472344573735855 +2442225623623421247333525262322235232325312323332262274221233342333122222131422246133222122234223232 +4556545662535764446315444662445595455534554945345544444623347223544155463585574343645553433152544538 +7364216153232723332366323361355162677721227222311834222542431653153389723455363347222722236247783162 +5335545535437815434574354255457553755255375453664734554455748552945363653468595654354462325737645543 +3446122425672433374142222422342322453315223442471422237423421323274372544229113224443271326211722272 +2237626422636542456356274136261535213663412774215737677147347366252435534167363321413346424122165189 +4332355443442235594543343443334445513483636235244522544544448533345633353435554355345344434243445433 +2422126234232242322224332344232224144521142522243243332225222225415224232332133221422232212213222235 +1233116323212231227331625416241525253132315222222322241277252722121252164282252246252729421325222122 +2431222123221314322323653244242525222122242544572422552125522222224242524221212324123222224242525522 +3335222443114433323434433524732255133326265333323324254433234214254363375421345277412222433422425225 +4534764343553334334333352452323273333355436352236434444332232553332233254251242536323534235432233233 +3333333233222233332433812343433223322433333143113223222423332212332412433212333214343343232113233213 +2222112221122322223333132222212213122222222212823422221221222122222221122122221222222221232321132224 +5346448495515245863956622647837827842697663485968757663687784777464384365535951732625727254246345622 +2521928152242622576622242346456255237211222222492282422219262122122611256221223172228442293851222126 +2372633413443327275252432125444791857285552622456842535524326481362854266286244286854336322412451631 +3341463233237322465316143653253325262263227282455146655222626533233643332535335274742322235333632453 +4246443525554546545465444455243555245353354794561524434256336445354378454572434558535553525343493585 +4272232444555414714772435245751283312243514557622454256459753336541545525224224527216122447214344455 +3432237331554533351349335554345316254334414273344234334253323333234133243533414333323335633281522332 +2433534334634623345433475234344423443454452244532434343343423434453462733242341446344253144336433343 +4341333431445322245432433214212232334233511224253521334444524325484444553123343233224333433422242124 +4342261322334323242133242251322322321322334432144132343423221313534143332412223343352124222143211433 +3224343432243422413334362631132122323222332342431234443523234433432343334333123223481223433443642342 +8847688576725554366745659589795868886565455898776776677924172572745656577884535326787867573278467262 +2254535216822796247722134938383322343723227843765573352221442892537242422712225922732433433434222732 +7784777799476947645675446467476535889744449778676953765277775999785859845866577786777577687866875795 +2222222442232224222213222232233222512211222223222233221322512224243422223332323232222223222211222432 +2227122222226121821522222222327221512225325222222625272623273222277224231122722228225122227722142442 +3221524531242224323342231223512323453253353243322233234223321223233333331223224131433132233334233112 +2424325234334242472233322444322614223343442513344322125228323383433432222222344224635442334334223112 +5232426322541224222225324457724232754428224354361123115254242554421461233212525728122222132212722223 +4746445362634322134332623632122244332224312453232353413232635623325562252424581555312432322212244456 +3421122122252322262223422522221212426223232241224124422421222232221222223222222211224213215522227531 +3111222222322222112222222222231222122111622222213132122161222222221122232122221221222222221222212132 +9555347745648269664666664522445446325243564455467656566365546697453293545377654564446143535534576652 +5536436434545632272516233733423776253365323636346733433273462263273376424536844273332656444442455362 +6945445546323234342533257234625336523453236537533344536363743535496356535236253667421546146325453517 +1221222235326245112252212231222521822222222222221422452226224243211222333222422212132112112221423422 +2227222622212232222212222222312272222212322157222222222231231221529223322232222125122122311922221131 +4444443433344533473543434333133444444553344414333384323344433343444424349534343434435333443324233353 +3312215555224442382223226122243212233416331331222226752322312132222323522273122222462266142362221222 +3343343332233642113332333133312323425334434332437323323323363355433343233333334333349333433323333313 +4242222112221412223222313121132233232222324221222222232322423222362424343322224222221342113314232433 +4325355323592333992223133343333349433533362354633333493363743333432323533222457343443344123214283233 +6243164412522449423425634363411642242542353235544444435443934444244644444442344326413235342322231233 +4535356445415356124373434385563645345423565355952445535375433653115235555554365536532363643552234335 +6774776766565174276777775566935456666657565766376744836474466657677764454536377582677655564334774344 +6577565536455555653226564775255754255556685557365655246457535746675584322777837785545854785667657756 +4432324434122422241122224233312232324222342462434212141254324432342132263222323333323441724232233122 +4243366219454247223232312264322443435333633553262923322213532216132213514323243621283232653234336433 +2133123235826223225345284452524442221226227524515422121122543223563423121334385446246326362282353421 +5344543453133323543253453534434324435531542155244324353445223354643543475645232352536244445445343555 +4262223222241223222222321222121224124221211243223355221211222122222112222213252211221322223222222222 +1311415431211423531345115225323412433232353315143122241242251425222511254413443211312154544344516789 +3285242726242153322434522134372332426631565422544432639227325545235122226522554423452242245134585546 +2442445232223242313334244223333344332323323324354241533312113436333333223233341233424363243132323153 +3455635735434563455564625614353354555452655622431345162432515545422252935463242333562564543522455415 +3142312122263212322233214425323222232332112223222223213422232121232424332324423322533332244326422212 +2424454462436242244761365443553533233352314444135248432332422243342233561412143374224354343264222443 +7587358357633243746358893938872526513457224638586356878255474264324254332623742564374745545337825564 +2132227252262222533222413422324634236574255122322565232235461243242235254262232223222224223222222523 +5623221345513335262541261123622554352126435224142552552452743253323694223222315612113234364282623376 +8434185256514664154546454336382464474635726472446446536252644296535426664345736428544446663257472665 +2529765761844438322215278575688235874693623466225983765948637585335884278754813445932649955579593814 +4551222493356454492644342213724485223631335429112325213223242222332136934424279526222451242478226125 +4654326132383524757117672473237665549275222833524636723753175872658564254765254718443453666578557875 +2526733767677568676636352485649776888473555636294455685673476444755448485668584976843674795355588314 +4226342324222221423222222122257632122222222221221222422222211221222313122243222222214722222222211222 +3234332215335136235223342343335342364328392333235216333341734232155333223238332333433233322222352332 +2333345413433643332233331534323235331133133334636365223335314322233336245943221353333413235334733333 +3443444523262426152222222336416425126361414426242243331543625542332423324324223444284345142344534143 +4254434978328226546562723662432224765327642322259572336443565462534455764233753876263544424314675692 +4335563577345142614422623289464365244353474275634445747554621475436477463255427336255652324225443424 +4446425435333336447433443334734354334344442443416835333443424343914444644244444334477843444344444448 +3346435765637575662533633363236433733443745214754346245557372528277272557132525747336343157843463423 +3336363532342364227323283336334335242453445445123334322221335332464332234424534533421436978524633422 +2222125222222342213421243652117122222112221225142412222323224223312273222112322422242434232123222423 +3213512222121322145922512243225663423622423322122312322224122522431222631315236324131262224371433222 +2454346334342372446442533432412434343443242224224324333331342343233412232312323434142245343442364743 +2327252674874345537243352236462444555555224133534353431442355754527252542433355434535813424555722876 +6852922272722511324222224211221222422222422467226242232172221252542225413115522622172192321126222372 +6139223523523533772162236336232732831132722222825411632226523624322332122152263226256422468234912653 +6364435565644354464554665463466836676364564536334365833385688855564544345266377373463465382773547646 +2222224623234113122222182222242612221322232233215421243434223532127222322213225315222322128225225222 +2222223125123531241552212222122215212223312232221213242221222422522222112322132222214221221521223322 +4322226232235232434244133212223332112232241332232412121342723931221126222222222215232433315314222213 +5464611263244621436463144426111113111256134166233434421425516451522463313634265422333442453554532789 +3383323228933223422321323823233831432684732442424614643274331234433335235534593322214245393274221434 +6444334444544245643483344242344234342422444445236343543632245546443434444344445244444437444636446434 +2294422322222312222221421222222221126231231132231212212322122222122242342222222522222642223132223322 +7235453542223868352662653436268634763674735333834383142323365234333112432363393531387232368235342414 +2324222222421322221222222221122211211221131321321222212222212232241112122212223211213232122222223421 +9339748364255357744437764437914373224344333833553577346544434679344355813244748547343444883454326856 +4411232327443414333453423323363312315422227322534234523134344334242332424343143235234321332345242234 +2232222122322212322322222422332222222334223312221222323322322222422222221122122222212533222223232225 +3522225291231562453224343265324332237234332223223762342371224428222312333625523322324423332531432223 +2224225423443222123222422342245213422222241213332344424422324341423222242413422434323252234521224323 +2228423336153333113373233224432522322423663235132342622138523333312277473647333426344272322334113233 +2235222151225283323322132222222421121332222421222244551325451223882751151122252712822312322122721221 +2231331223333232513114334424431741332233323113432213333323612421324133233222333223323222122232322322 +2222223222124432112221211112241223222262134622112222321224223222324222223323232182222223423323321132 +5534292815722822325484224922735375472163241348133324344434622423552224433222321992421314433533245272 +5576686766666666667756677677856676665376666757865366668677757656569656679657966666857757465536764695 +2222432234924353243445434541523244643521313554151313341789443536454422443535342413234432252322222513 +3333442232164232245232724434242333422243243315634435336432225425245383234222334212322232214342343121 +4444444444543444152455544334244413445443344348333554434334244543334543443444444284334243444444545445 +4461226324322228422323722236243222242261222244443453365222222315222223265321362244521843223215431335 +1463233331152355213585545311245423233414144322324244345122514434345442232422325244362532451272224643 +6237332323422352964655525245226616726743166655262613665546526951215333324122156554347114366466325566 +3459889339748743654543318534845355844199536463675485775455649943636435244668565438574567958658244574 +3572374685794368584873742656673655756275455556555956756383758454756456612576975875475573756537655566 +3332522642223223227326312332212333333235233533232233333332221133322245646333323338323333322313235335 +2215222224323132522222122242222625223563236152245232522244226223142567114236422245122211521222462212 +2362554442615533464526655646685217666364665625215332333563254664523246234745666642463534563562426538 +5344642454252342644344264544436334484242244555544454434535444464425225445351532424553364266223444246 +3533533652353674534668657697735647686245873258252774755869653392892298562837235143433583567353574234 +5455313234423252223354443334443333422333532233433355133544443245233622734132323454536455452222332513 +2528423242255843232714223729249222224212122227323223522722123424427532244214434481354423323324548454 +3333333533223933333332323333333524343331333333322332433343333225332222333223633434223333333333333333 +4234345153544334334454232353322332254321432323334543454333642434492335333234353524553244436612534433 +3695964637346664384456457355465966563534358567648685546625765475796567882466565667572475871454837464 +2122212224212232272223232173322332152232322315323422231222452124533322425322123211324342226222221122 +6333544543453242423235237463354234342347953243624142437334332556357423544328246624653425334443142347 +4952677585253568499684767769678774193798673878856769974895877753785597873754965758473753687447887574 +4443441311446541424153417243424727434342432564545461534445333447535446343364244234343233534443343445 +3332233352233336133233362333342333233523633432132333243233353324323353323232236332343226133133336233 +2864352132665758422323652512352242336222224426522235222542332462342441215445252535322252562452222223 +2444444284543222283444642332428422444342433913444433443443456434334433374346325222457534453244446341 +1222414531262433263323213222411223454132332226342143511212243234234422245732232513334322245542524425 +3322422334232133425522333232242352133431245114425227252223324271224325232225412422212523354341246462 +3122534225524222235221242155232133242223332344414523224552413333233211272513423427123443222224144524 +2432221222223232222212412231642222222122422222222221162224221222223234312322282221221222622224224212 +4433433324527566366634324359473344434345463654465564743244354346485454332635534465443444753544555435 +2642332332832218548122742424544637254524342332422211612212372326232535141211224622372732492332323231 +1464673353442253456425445343644544754454586234445444512344545434454643445453353253447434444565544446 +6336848775573465664557934386654556467575827628548756534656644458542763645565636645455396757438755653 +3217353332252322226542122127173322472631235611234322244341721352322316121922212257233343444265223411 +3664468676466666584595656567656665896559545849956465395566565665746564764455945465664666694664686454 +3522324333322323363846333432355232324333343324333472134333333233422331253533363333335136644322342333 +4416623344454344254332434253832224942654455844345437445442344545444454323414344335444612424344422255 +3384266363652522213243335434255448332344463232352143334363332324226522321233264341221332322352232227 +2313233241341353332383331463133432362314522322644314831333232154542335421533417233323265323332133433 +4465627933899335256554335222975645724479732222375485235475476553667847867735257354127825445775595554 +3724452222423143621224733234132233331563322432333223233435314133632231361535262323222332132634532413 +5324314137432343373433323452542733231334523455324445353739332371376533433342322633234332643263742446 +3543339221322332222233233122211238952722263331172222322312122323213233333332323323472222232923532236 +2221243232121225233332242222222223222122122214322722123222932212241221222226211222224222126372222222 +3235431122364325122132362223423312122245134323222755229222232137233394133322733671622333324232734275 +3655666646642236566543564633536556244668745656664662566265454672345647654426451345396346664636654434 +2414224143443134434444433534333342441645413442434464234223331333442324332424431423333624442123344424 +2423142223243243223322142222222332233222422224312214212252132213242222226222442221422353224121232224 +1123222232122123312222222222322222222222234223323223222111182113222622122522222233222222222234222122 +1111223222226286422427122422152242622622522221722222432424222213223282252232112266352123322221221132 +3251125816647864762453227237265425327658286252844745877333397555283751427766127367628212222535653942 +4745526344232352433621442252227223264412466214236472254223683334521614414364425321224234142224242255 +4896889766666878538985878773938798983858775886577858979463769797877967457885679486567678957578867268 +5412223222333322423223322232221232231232142522242233221212352212222322822332222121222222213235222225 +3342533722236333322633425352248943333664335354553353432463345313443143243616753253533345354575333571 +4678464466272463187638887296253245887867665577324564812857854686562322178654443757539683655442747392 +2343326222244242232222325252223142322263322422132132252552221223432213221425222122323623323312122252 +8558436558116651286214124165651284672866741134271582447768775475181888861255468185124332353332162869 +6641426526646321533436582212615552753536532427452666366362225556253531733461233333424236332554254265 +3121333153331763422535223326323366214244153423612262243462461632123332223232252622322623623631623431 +4436623333324863351343243133524432349433544273423335424254333364333334293333234433336334334533545834 +5564642649124665222414663664874335643536643667633664653351648656686846466266646354366424455413578477 +1333333323322214343223532243224133422224423244245112214221313223432312122322242442422222122232422355 +4637826528162254253548554643336758337477322634357444273645322366961553555284426627354823321222235866 +3712832224233226222211231722212237532215482722122223233252425225232331222222122443665319122222222514 +2222132432222132423333424122322232422419224222223232212121113222333243231482222562232422442322233412 +1322232245222415222432632212222232132125222522222424251221232212222224137321221142152242222112122421 \ No newline at end of file diff --git a/src/main/resources/day3/input_example.txt b/src/main/resources/day3/input_example.txt new file mode 100644 index 0000000..6b1df6a --- /dev/null +++ b/src/main/resources/day3/input_example.txt @@ -0,0 +1,4 @@ +987654321111111 +811111111111119 +234234234234278 +818181911112111 \ No newline at end of file diff --git a/src/main/resources/day4/input.txt b/src/main/resources/day4/input.txt new file mode 100644 index 0000000..78fe08f --- /dev/null +++ b/src/main/resources/day4/input.txt @@ -0,0 +1,136 @@ +@@@@@@@@@@@@.@@@@.@@@.@@.@@@@..@.@@......@@@@..@...@@@.@@@.....@.@@@@@.@@..@.@@.@..@@@.@...@@@@.@.@.@@@@@@@.@.@@@..@...@@@.@@@..@@...@.@ +.@@....@@...@@@.@@@.@..@@..@@@@.@.@@.@.@@.@.@.@@..@@@@.@.@..@.@.@.@.@@@@@..@@@@@@..@@@@.@@.@@@@@@@..@@@.@.@@@@@@.@@@@@.@.@@.@@@.@...@.@. +@..@.@..@@@@.@@@@..@@...@@@@@@@...@.@@@@@@@.....@@...@@.@@......@@@@.@@..@@@..@@..@@.@.@@@@@@@@..@@.@@@@@.@@@@@@@@.@@.....@.@@.@@.@..@@@ +@@@...@..@...@@.@@@...@@@@.@@@@@@@@.@@.@@@@@.@@@..@@@.@@.@.@@@@..@@@@@@@@@@@@.@@.@..@@@@..@@@@.@@.@.@@..@@@@@...@@@@@@@@@@@.@.@@@@.@..@@ +..@@.@@@.@@@@@@@@@@@.@@.@@@@.@.@.@@@@@..@@@...@..@...@@....@@.@..@@@@.@@.@@@@.@@@@@@@@.@@@@.@@@.@@.@@@..@@.@@.@.@@@.....@@@@@.@.@.....@. +..@........@@@@..@@@@@..@.@@@.@.@..@.@@@@@@@...@@..@@.@..@@@@.@@.@@@.@.@@@@.@.@@@..@@@@@..@@.@@@@@@@@@@@@@@.@@@.@@@@@@@..@@@@@....@@..@@ +@@@@.@.@.@@@@@@.@.@@@@.@.@...@.@@@.@@@@@@@..@@@@...@@@.@@@@@..@@@.@..@.@.@.@@@@.@@@@.@.@@.@.@.@..@@@@@@@@@@@@@@@@@@.@.@@@.@.@@@@..@@.@@. +.@@...@.@@.@@@@.@@..@..@...@@.@...@...@@@@@.@@@...@@..@@.@@@@.@@@.@@@@@.@@.@.@@..@@@@@..@@.@...@..@@@.@..@@.@.@@..@@@@...@.@@@@@..@@@@@. +.@.@@@@@..@.@.@@@@@...@@.@@@@@@.@.@.@...@@.@@@@@@@@.@@@.@.@@@@..@.@@@@@@@@.@.@@.@@@.@@@@@@@@..@@@.@@.@.@@..@@@.@@.@.@.@@@.@@@..@.@@@@@@. +.@...@@@@@@@@...@@@.@@@@.@@@..@..@@@..@.@@@@@@@@@..@@@.@@.@..@@.@@@@@..@@@.@.@@@@@@@..@.@@@...@@.@.@@@..@.@@.@@@.@.@@@@@.@@@@...@..@@.@@ +@@@@..@.@@.@.@@.@@...@@@@@.@.@.@@@@@@@@@@@@@@@@@..@.@@.@@..@.@@.@.@@@@@@@@@@@.@@@@.@@@..@..@.@@@.@@@@..@@.@@@@.@@@@.@@.@...@.@..@@@@@@@. +.@.@.@@@@@.@@..@@@@..@.@...@@.@@@@@@@@.@@.@@.@@.@@.@@.@@@@@@.@@.@.@@@.@@..@@@@@.@.@.....@@@.@@@@@@..@@@.@@@@@@.@.@@@..@@@...@@..@.@@@@.. +@@.@@@@@@@.@@@@@@@.@@..@@@@@@.@@@@..@@.@@@..@@.@....@.@@.@@@...@@@@@.@@..@@....@@.....@@@..@@.@@@.@@@..@@.@@@@@@@@@@.@@@@@@@....@.@..@@@ +.@..@@@@@@@@@@..@@@.@.@...@.@@@..@...@@@..@@@.@@@@@.@..@@@@.@@@..@.@.@@@@..@@.@@@@@@.@@.@.@@@@@@@@@@@@....@@.@.@@@.@.@.@@@@....@@@.@@..@ +@@@.@..@@@@@@@...@@@@@@.@.@@.@@....@@@@.@.@@.@@@@.@.@@@@@.@@@..@..@@@@....@@@...@@@@@@.@@@.@@@..@@@@@@..@..@@@@.@..@@.@.@.@.@..@.@....@@ +.@@@.@@@@@.@@@@.@@..@.@.@@@.@@@.....@@@..@.@@@..@.@@@@@@..@.@.@.@@..@.@.@..@@.@.@.@@....@@..@@@.@@@@@@@.@@@@..@.@.@@@.@@..@@@@..@...@.@@ +@@.@.@@..@@@@@@.@.@@@..@@..@@@@@.@..@.@....@@@...@@@@@@.@@@.@@.@@@@.@@..@@.@@@@@....@@@.@.@@@..@.@@@@@@@.@@..@@@..@@.@@@@@@@@@@.@.@@.@.@ +@@.@@@@.@@@@@.@.@.@.@@@@@..@@@.@.@@..@@..@.@@.@.@.@@.@.@@..@@@@..@@@..@..@@@.@@@@@@.@@@@@@@.@@@@@.@@@@@.@@@.@@@@..@..@..@@@@@@.@.@@@@..@ +@..@@..@@@.@.@@@..@.@@@...@.@@@..@@.@..@@@@@.@@@..@@@@@@@@@...@@@@.@..@@@.@@.@@..@@...@.@@@@.@@...@@@@@@@@..@.@@..@@@.@.@.@@@@@@.@@@.@.@ +@@@@@@....@@@@.@@.@....@@@@..@@@@@@@.@@@@.@@@@@.@@.@@@@@@@@@@@@.@@@@@.@..@@.@.@@@.@@@.@.@@.@.@@.@@.@.@.@.@@@@@@.@@@.@.@.@@..@.....@@.@.. +.@@@@.@.@@@@@.@@@@@@@@.@.@.@@@@.@.@@..@@@.@.@..@.@@@@.@.@@@.@@@@.@.@@@@@@@@@..@.@..@@...@@@@@@@.@@@@.@.@@@...@.@.@@@@@.@.@@.@@@...@@@@@@ +@@@@.....@@.@@.@@@@.@@@.@@..@@@@@..@@@..@@.@@.@@@@.@....@@@@@@.@@@...@@@@@@.@@@..@@..@@@.@@@@.@@.@.@@@@@@.@..@..@@@@@@@..@@.@.@.@.@@@@@@ +@@.@.@@@@@@@@..@@@@.@@.@@.@...@@@.@.@@..@..@.......@@@@@@@.@@.@@@@..@.@@.@@.@@@@@@@@@@@.@@..@..@@@@@@.@@@@@.@@@@@@..@.@@.@@@@@.@@@.@@.@. +.@@@@@@@.@.@.@.@@@@...@@@@.@@@@@@.@@@.@@...@@@@.@@@.@@@@@.@.@...@@.@@..@@@@@@@@.@.@.@@@...@@.@@@@.@@.@@@....@@@@@@@@@@@@@@.@@..@@@@@@..@ +@@...@.@.@@@@.@@.@...@@.@..@@@@...@@@@....@.@@@@@@..@@@.@.@.@...@@@..@@@@@@.@@.@.@.....@.@@...@.@@@@@@@@.@.@@@@@.@@.@@@@..@@.@@.@@@..@@. +@@.@@@@@@@@@@@@..@@@@@@@@..@.@@@@@.@@@@@@@@@..@.@@@..@@.@.@@@@@@@@@@....@..@....@@@..@@@@@@...@@@@.@.@.@@@@.@@......@@@@@@@..@@@@..@@.@@ +.@.@@@@.@@@..@...@@.@@@.@@..@@@@@.@.@.@.@...@@..@.@@@@....@@@@@@.@@.@.@@@.@@@..@.@@@@@@.@@..@@.@@@..@.@@...@@.@@@@@@@@.@@@@.....@@..@.@@ +@@.@@@@..@@..@@..@@@@..@...@@@..@.@@@.@@@@@.@@@@@.@@..@@.@.@.@.@...@@@@@.@.@@.@..@@@.@@@@.@@@@@@@@..@...@@@@@.@..@@.@@.@@@@@.@@...@@@@@@ +@.@.@...@@@@..@@.@..@.@@@@@@@@@@@@@@.@@.@@@@@.@@@.@@....@.@@@.@@@@..@@.@@@..@@@.@.@@@.@@.@@.@@...@@...@@@.@......@.@@@@@..@...@@@@@.@.@@ +@@@@.@@@..@@@@@.@..@@@@.@@@@@.@@.@@.@.@..@@.@...@.@@@@@@.@@@@.@@.@.@.@..@@@@.@@.@@@@@@@@@@@@@@.@..@@.@@@@.@@@@@@@.@.@@....@@..@@..@@@@@@ +.@@.@@..@@@@.@@.....@.@@.@.@.@@.@@@@@.@@@@@@@@@@@.@@@@@...@@@.@.@@@.@..@@@.@.@.@@@.@@.@....@@..@@@@.@.@.@@.@@...@.@@@@@@.....@@@@@@@@@@. +@@.@.@@@@@@.@@@.@@@@@..@@@@@..@@@.@@@.@@@@@@@...@@.@@@@.@@.@@@@.@@.@..@.@@@@@..@...@.@@@.@.@..@@@...@@@@@@.@@@.@.@@@@.@.@.@@.@.@@@@.@... +@@@@@..@@@@@...@.@@@@.@@..@@.....@@.@@@@@.@.@..@@@@@@@.@@.@.@@@@.@@@@@.@@@.@..@@@...@@@@.@@.@@@@@..@...@.@..@@@..@.@@.@@.@.@.@@..@..@@@. +@@.@@@@.@.@@.@..@@..@..@.@.@@@....@..@.@..@@@@@@@@.@@@@.@..@.@@@@.@....@.@@.@@@@.@@@@@@@.@@.@@..@@..@..@@@@.@@...@@..@...@.@@@.@@@@.@.@@ +.@@@@@@...@@@@@.@@@.@.@@@.@@@@@.@.@@@@.@.@@@.@@@@@.@@@.@@@@@@@..@.@....@@.@@@..@@@.@@@.@...@@@.@.@@..@@@@@@.@@.@.@@@...@@.@@..@.@@.@@... +...@.@@@.@.@@.@@.@.@@@@..@@@@.@.@...@.@@.@@@@...@@@@@@...@@@@@@@@@@@@.@.@.@@@....@.@...@.@@@.@@@@@@.@@.@@..@@@@@.@@.@@@@.@..@@@...@@...@ +@@@.@......@.@@.@.@.....@..@@.@.@@@@@@.@@..@@@@@@..@.@@@.@@@@..@@.@..@@@@@@.@@.@@@@@@@..@@@@.@@@@.@@@..@@@@@@@@@...@.@@@.@@.@@.@@@@.@@.. +.@.@@@@@..@..@@.@@@..@.@.@@@....@.@.@@@@@.@.@@@.@@..@@.@.@@.@@@..@.@.....@@....@.@.@@.@..@@@.@@.@@@@.@@.@.@.@@@@@..@@.@@@@@..@@.@@@.@.@. +@@.@@@....@@@.@@@..@.@@@@.@@....@..@@@.@@@.@..@@@@..@.@.@@...@@.@@@@.@@@@.@@..@@@@@.@...@@@@@@.@@@..@@..@@@@..@@@.@@@@@@@@@@.@...@@@.@.@ +.@@@@@.@@@@@@@@...@@@@....@@@@@@.@@@@@@@..@@@.@.@@@..@@@@@.@@.@@@@..@@.@@@@..@@.@@.@@@@@@@@@.@@.@@@..@@.@@.@@@.@@@@..@.@..@@.@@@.@@.@..@ +...@@@@.@......@@@.@@@@..@@@..@.@@@..@@.@@@.@..@@@....@@@@@@.@@@@@@@@.@.@.@.@@@@...@..@.@.@@.@...@@@..@@@.@@@.@@.@@@..@.@@@@..@@@@...@.@ +.@..@@..@@@..@@.@@.@@@@.@@.@@@@@@@@@@.@..@@.@@.@@.@@@@@@@@@@@@.@..@@.@@@@.@@.@@@...@@..@.@@@@@@@.@@@..@@@@....@.@@@@@@@.@@@.@@.@..@@@@@. +.@@.@..@@@@@.@@...@@@....@@@@.@@@@@@.@@..@@@@.@@@@.@.@@@.@@@..@@@@..@@...@@@.@.@@.@@@@@.@@@.@@@@..@.@@.@@@@@@.@@@@@@@@.@@.@@@@.@.@..@@@@ +.@@.@.@.@@@@.@@@@@@@@.@@@@@.@..@..@@@@@.@...@@@@@@@.@.@@..@@@@@@@@@@...@@@@@...@@@@@@@@@@.@@...@@.....@..@@@....@.@@..@.@@.@@@@@@.@@.@.@ +@.@@.@@@@@.@@@@@@@@@.@@@..@.@.....@@..@@@.@@@@@@...@....@@.@.@@.@@@@@@@@@@@@..@@@@@@.@..@.@@.@@@@@@.@....@@@@@@..@@@.@@@.@@.@@@..@.@.@@@ +@@@@@@..@@@@@@@.@...@@.@.@@@@@@@@@@.@@.@..@@@@@@@@@.@@@@@.@@@@.@@..@@@@@@..@@....@.@@@..@@@@.@@@.@@@@@@@@..@...@@.@@@@@..@@@.@@@..@@@@@@ +@@@@@..@@@@..@@@.@@@..@@@@@.@@@@.@@@.@@@.@@@@...@@@.@@@@@..@@.@@@@@@.@@@...@.@@...@..@@.@@..@...@@@@..@@@@..@@.@@@@@...@..@@..@@.@@.@@.@ +@.@@...@@...@.@@.@.@.@@@.@.@@.@@@@.@.@@...@@@..@@@@@..@@@@@@@..@@.@.@@@@@@@...@.@@@@..@@@@@@@@.@.@@@@@@..@...@@..@@@@.@.@@@..@@@.....@.@ +..@@.@@.@@@@@.@@@@@..@@@..@@@@@.@@@@.......@@@@.....@@@.@.@@..@@@@@@@@@@@@@.@@@...@.@@.@@@.@...@@@@.@..@@@.@..@@@..@..@.....@.@.@.@..@@@ +@@@@@@..@@.@..@.@..@.@@@.@.@@@@@@@....@@@..@.@..@@@.@.@@@@@@@.@@.@..@.@@.@@@@@.@@@.@.@.@@@@@.@.@@@@..@@@@.@@@.@.@@@@@@..@@@.@@@@.@.@@@.@ +@.@@@..@..@.@....@.@.@@..@@@@.@@@@@@@@@@@@@@@@@@@.@@@.@@@.@@@@..@@@@@.@@...@@..@.@@.@@@..@...@@@@.@@.@@@@@.@@@...@@@.@@@@.@@.@@@@@@..@@@ +.@.@..@@@@.@@@..@@@@@@@@@@.@.@@.@.@@@@@@.@.@@..@....@@.@@.@.@@@.@@.@.@@@.@..@@..@@.@@..@..@@@@..@@..@@@@@..@.@.@@@@..@.@@.@.@@@@@.@@.@.@ +@...@..@@@..@..@@..@@@@@@.@@@..@.@@@@@.@..@@..@@@@.@...@...@@.@@@......@@.@@@@.@@@..@@@@@@@@@@@@@.@.@.@@.@.@.@@@@@.@@@@@@@.@@@..@@@@..@. +@@.@@@@@@.@@@@....@@.@@..@@.@..@.@@..@@@@@.@.@@.@.@@@.@@@@@@@@@@@@.@@@@@@@@..@.@@@@@@.@.@..@@@@.@@@@@@@.@@@@.@@@@.@@@...@@@@@@@.@@...@@. +.@..@..@@@@@.@@.@@@@@..@....@.@.@@.@@@@@.@.@.@@.@@.@@@@@@..@.@@@.@@@@.@....@@@...@..@.@@@@..@@@.@@@@@@....@.@@@...@@@@@@@.@.@@@@@@@@.@@. +@@@.@@.@@@.@.@@@@@.@...@.@@@@@.@....@.@@.@.@@.@.@@@@.@@.@@.@@@@.....@@@.@.@.@@.@@@@@.@@..@@.@@@@..@@@.@..@..@....@.@@.@@@@@..@@@@@..@@@@ +.@@@...@@....@.@@@@@...@@.@@.@.@.@@.@@@@..@@@@.@@@@..@@.@@@@@.@.@@@@.@@@.@...@@@@@@@....@@@@@@.@@..@.@@.@@@@@@.@@@.@.@@..@@@@.@@@@.@.@@@ +..@@@@.@..@@@.@@@.@@@@.@...@@@.@@@@.@....@@...@@@@@@.@@@...@.@.@@..@@@@.@@@.@@@@@.@@....@.@@.@@@@@.@@@@..@.@@@@@@..@@@@.@@@.@.@@@..@@@@. +@@@@@@....@.@@@@@..@@..@.@@.@@@@@@@@@@@@@.@@@@@.@@@@@.@@.@@.@@@.@@@@@.@.@.@.@@@@@@@@@@@@@.@@...@@@@.....@.@@.@@@.@@.@..@.@@@@@.@@@@..@.@ +@@@.@@..@@.@.@..@..@@@@@@@@....@@@...@.@@@.@@@..@@.@..@@@@.@..@.@@@@.@@@..@.@@@@.@@@@.@....@@.@@@.@@..@.@@.@..@.@@@@...@@@@.@@...@@@@@@@ +@@@@.@.@@@@@..@@.@@@@@.@@.@....@@@@@..@.@@@@@.@..@.@.@.@..@@@@@..@@@.@@@@@@@.@.@@.@.@@.@.@@.@@@@@..@.@..@.@..@.@@@.@..@@@@..@@@.@.@.@@.@ +.@.@@@.@@@@@@.@@.@@@@@..@@@.@.@.@@.@@@@@.@@@...@.@@..@@@@@.@.@.@@@@.@@@@....@@@@..@@@...@@@@@@.@@@..@@@..@@@@@@@.@.@@.@@@@@@@...@.@..@@. +..@@..@.@..@@@@@.@..@@@@@.@@@@@@..@.@.@@@.@@@@@@..@...@@@@.@....@@@.@@..@..@@.@..@@@@@@@...@@@..@..@@@@....@@@@@@.@@@.@@.@@@@@@.@@@@@@@@ +.@@@@.@@.@@.@@@@.@@@@@.@@@@@.@@@...@..@..@@@@@.@@.@@@@@@@@@@@@@@@@.@.@@@.@..@@@@....@@@..@@@@@@@..@@@@@@.@@.@.@@..@@@@.@@..@@@..@.@@@@@@ +@@@.@@@@.@@@@@@.@@.@@@@@@@@@@@@@@@.@@@.@@@.@@@@@@@..@@@@@@@@@@..@@@@.@@@@.@@@@@@@@..@.@@@.@@@.@@@@@.@@@@.@@@@.@..@@@.@@@..@@@@@@@@@@@@@@ +.@.@@@@@.@@..@@..@@@@.@@@@..@@@@@@@@.@.@@@.@.@.@@@@@@.@@@.@@..@@@...@..@@@@@@@@..@@.@...@@@@@.@@@@....@@@@@@@@@@@..@.@.@.@.@@@...@@@@@.@ +@@.@@.@..@..@@.@..@...@@..@@.@@.@..@.@@.@@@@@@@@@@..@@@@.@..@@.@@@@.@@.@@.@@..@@@.@@@@@.@@@..@@.@.@@.@.@...@@.@.@@@@@.@@.@@.@@.@..@@@... +...@...@@@.@@@@@@@@@@@@@@@@@@@.@@@..@@@@@@@@.@@@@@@@@@@.@@@.@.@@.@.@.@@@@@@@@....@@@@.@@@.@@.@@.@@@.@@@@@@...@@@..@....@....@...@@@@.@@. +@@.@@@.@@@.@.@.@..@@.@@@@@.@@@.@.......@..@@@@.@@@...@.@....@@@@..@.@@@@.@@@.@@@@.@@@@@....@@.@.@.@.@@@..@@.@..@@@@@.@.@@@@@@.@@@...@@.@ +.@@.@@.@@....@@@@..@@@@@@@.......@..@....@@@@@@.@.@@@.@@...@..@@@@@.@.@@@..@.@@.@@@.@..@.@@.@@@@.@.@@@.@@@....@@..@.@@@@..@...@@..@..@.. +@@@@.@@...@@@@@@@@.@@@@.@..@..@@.@@@.@.@@.@@@..@@@..@.@@@.@@@.@@.......@.@.@..@@@@@.@@.@@@.@@@..@.@@...@...@.@.@@@@@@@.@@@@@@@@@.@..@..@ +@@@.@.@@.@@@@.@@@@..@@@@@@....@@@.@@.@@.@..@@@.@@@.@@@@..@@@@@.@@.@@...@.@@.@@.@@@.@@.@...@@@@@@@.@@@.@@@@.@.....@@@@.@@@@@@@@@@@.@@@.@. +.@..@@@@@@.@.@.@@.@.@....@@.@@.@@@@.@@....@@@@@..@@@@.@.@.@@@@@.@@@@@@@@@@..@@...@..@@@@..@@@@.@@@@..@@@@@@@..@@.@@.@@@@@@...@.@@@.....@ +.@@@@@..@@@@.@@@@.@@@@@@.@.@.@@...@@...@..@.@.@@.@.@.@@@.@@..@.@@@@@@@.@@@@@@@.@@@@..@@.@..@.@@.@@@.@.@@.@@..@@@.@@.@@@.@@@@.@@@..@@@@.. +..@@@@@@.@@.@@@.@@@.@.@@@@@@@@@@@@@@@.@@@@@@..@@.@@@@@@@@@@...@@@...@@@@..@.@@@.@@.@@@@.@@@.@.@.@@@@@@@.@.@@@@..@@@..@.@..@..@@@@@.@@.@@ +@@@.@.@@@.@@@.@.@.@.@@@.@@@@@@@@@..@@@@.@@@.@@@..@@@@@.@@.@@@@..@@@@@@.@@@.@.@@.@@...@.@@.@@.@@@@@@@@.@@@.@.@@@@@..@@..@@@.@.....@@@.@.@ +@@@@..@@@@....@@..@@..@.@.@.@@@@@@@@@@@.@@@@...@@.@@@@@@@@.@@.@@@@@.@.@.@@@@@.@@@.@.@@@.@@@@@@.@..@@..@.@@@.@@@@.@@.@@@@@@@@@.@@@.@@@.@@ +.@@..@.@@@@.@@.@@@@.@.@@.@.....@..@..@@.@@@.@@@.@.@.@@@@..@@@@@.@@@..@@@..@....@....@@.....@.@@@@@@@@@...@@.@@@...@@@@.@@@....@.@.@..@.@ +@@.@.@.@..@@@.@@.@.@@@@@@@@@@@.@@...@@@@@@.@@@@@.@@.@@@.@.@@.@@..@@.@@@.@@@@@.@..@.@@....@@..@@@.@.@@..@.@.@@@.@..@@.@@@@.@@@@.@@@@.@.@@ +.@@@.@@.@.@@@.@@@@.@.@.@@@.@.@@@...@.@.@@@.@.@@.@@@.@..@.@.@@.@@@@@.@.@.@@@.@@@..@@...@@@@@@..@.@@@@@@@@@@@.@..@@.@@.@.@.@.@.@.@.@@@@@.@ +@@....@@@.@@@@@@@...@@.@.@@.@.@@.@.@@.@@@@.@@@@@@.@@@@@..@.@@.@@.@.@@.@@@.@@@@@@...@.@.@@.@@..@.@.@@@@.@@@.@@@@@@....@@@@.@@@@@@@@@@.@@@ +@..@.@@.@@@@..@@@@@@@..@.@@@@@@@@@.@@@...@@..@.@@@.@..@.@@.@@@@.@.@@@@@@@.@@@.@@@@@@@@..@@@@@@@@.@@.@@..@@..@@.@..@..@.@@.@...@@@.@@@@.. +@@.@.@@@@@.@.@@.@@@@@.@@@@..@@@@@@@@@@@.@.@@@...@...@.@@..@@@@@.@@..@@@@@@@@@@@@@@@@@@....@@@.@.@@.@..@..@@@@@@@@@@@.@.@.@.@@.@@....@@.@ +..@.@.@@@@@@@.@@@@@.@@@.@@@@@@@@@..@@..@.@.@@@@@@@..@.@.@.@@@@@@@@.@@@...@@.@@.@...@.@@@..@@@@@@@@..@@.@@..@@@@@.@@@...@@@@@@@@...@@.@@@ +@.@@.@@@@@@@@@@@.@.@@@@@@.@@@@.@@@@...@@.@@@.@@@.@@..@@@@@@@.@@@.@@@@@@@@@......@.@@@@.@@.@@@.@@@@@...@.@@.@.@.@.@.@.@@@.@.@@@@@.@.@@.@@ +.@@.@@@..@@..@@@@@..@@.@@..@@@..@@@.@@.@@@@@..@@@@@@@@.@@@@@..@.@@@@@@@@@.@@.@.@.@@.@.@@@.@@@@@@.@@.@.@@..@@@@@@@...@..@.@@..@@.@..@.@@. +@..@@.@@@@@@@@@.@@@.@@@.@..@.@.@@@@@@..@@@@@..@@.@@.@@.@@@@@.@..@@..@.@@.@@@@@.@@@@@@..@@....@.@@.@@@..@..@@@.@...@..@..@...@.@@.@...@@@ +@.@@@@..@@.@@@.@.@@..@@..@...@..@@@@.@@@@@@@@@@.@.@@@@.@.@.@@@@@@@.@@@@...@.@@..@@.@.@.@.@.@@@@@.@@@@.@@.@@.@@..@@.@.@@@@@@@..@@@.@@.@.. +@@.@@@@@@@@@@.@....@@@.@..@@.@.@@@.@.@@@@@@..@@@@.@@@@@..@@@.@@@@@@@@@@@@..@@@.@@@@@@@.@@..@@.@..@@..@@@@.@@@@.@@@@.@@@.@...@..@..@@@..@ +@.@@@@@.@@@@@.@.@@@@.@..@@@@.@@.@@@@.@@@@@..@@.@.@@@@@@.@@.@@@@@@..@@@@.@@@@@@.@.@...@.@..@@@@.@..@@.@@..@@@@.@.@.@.@@@@@.@.@@@@@@@.@.@. +@@@@@.@@@@@@@@@@..@@.....@@.@@@@@@.@@@.@@@..@@@..@.@.@...@.@.@..@@@@@.@@..@@@...@@@@..@.@@@@@@@@@@@.@..@@......@@@..@.@@@@@@@.@@@...@..@ +@@@@..@@@@@.@@.@..@.@.@.@@@.@.@@@.@@@@@.@@@@@.@@@@.@@@@@.@@@...@@..@@.@.@@@.@@@@.@.@@@.@@@@@..@@@@...@@@@@@@.@.@@....@.@..@..@@..@..@@@@ +@@.@@.@@@@@...@@..@.@@..@...@@@@.@@..@..@@@.@.@@.@.@@@@@@..@@@..@@@.@@@.@@@@@@@@@@.@..@@@.@..@@@.@..@@.@.@@@@@.@@@@.@@@...@@@.@..@@..... +@.@@@@.@..@@@@.@.@@@.@@@@.@@@@...@..@@.@@..@.@@@.....@@.@@@@@@...@@.@@@...@@@@@.@.@@...@@@@@@@@...@.@@.@..@@.@@.@@@.@.@@.@@@@@..@.@.@@@@ +@@@@.@@@@@@@.@.@@@@..@.@...@...@@..@.@@@...@...@@@@@@@@.@@.@@@.@@@@@@@...@@.@.@@..@@@.@@@@@.@.@@.@.@.@@.@@@..@..@@@.@@.@@.@@.@@@@@@@..@@ +@@@.@@@.@.@....@.@.@@@...@.@@@@@@@..@.@...@@@@@@@@@.@@@@@@.@@@.@@.@@@@..@@@@@....@@@.@@.@@.@@@.@@@@@@@@@.@.@.......@..@..@..@@@@@.@@@.@@ +@.@.@@@@@@@@.@@.@@..@.@@@..@@@@.@@.@@.@@@@@@..@@@@@.@@@..@.@..@@@....@..@@@@@@@@.@@@.@@..@@..@@@.@@..@@@.@@.@@@@.@@@.@@@@@@@@@@.@.@..@@. +.@.@@@.@@.@.@.@@.@@..@.@@@@@@@@@..@.@.@@@@@@....@@..@@@@@@@@@.@@@@@@.@..@.@.@@@@@@@@..@.@@@@@@.@...@@@@@@@.@.@.@@@@@@..@@.@@@.@.@.@@@... +@@.@@@@@@.@@.@@@...@@@@........@.@@@.@@@@@@.@@.@@..@..@..@@@..@@@..@.@@@@@.@.@.@..@@.@@@@@.@@@.@.@.@@.@.@.@@@@.@@.@@@.@@...@@.@..@@.@@.. +@.@.@@.@...@.@@@@@.@@.@@@@@@@@@..@@@@@..@.@@..@..@@@@.@@..@.@..@@.@@.@.@@@.@@.@.@@.@.@@@@@@...@.@@@@..@@@@.@@@@@@@.@.@.@..@.@@@@@@@@@@.@ +.@@@@.@@@@@@@.@@..@@@@@@@@.@@@@@..@@@@@@.@@@.@@..@@@@@@@.@@..@...@@@@@@@.@@.@@.@@.@@.@@@.@@.@.@@@@@@.@@@@..@...@@@.@@@...@@@@.@.@@.@@@@@ +@.@@@@..@@@@@@.@.@@...@@@....@.@.@@@@@.@.@@..@.@.@@..@..@@@@.@@..@.@..@.@@@.@@.@.@@@.@@.@..@@@@@....@@@....@@..@@@...@@.@.@@@@@.@@@@@@@@ +@@@...@.@@.@.@@@@@@@.@@@@@@.@.@.@@.@@@.@@.@@...@..@@@@@@.@@.@@@@.@@@@@@@..@@.@@@@@@.@@..@@@.@.@@@@@@@@@.@@@.@..@@@...@@...@@@@@@.....@@. +@@@@.@.@@@.@.@.@.@@.@..@@.@@.@@.@@@@@.@.@@@@...@@@.@@@@@.@@.@@@.@@@.@@@@@.@.@@@.@@.@@@@@@@@@@@@.@@@@....@.@@@.@@..@....@..@@@@@@@.@@@@.@ +@@.@.@@@@@@.@@@..@.@@@@@@@@.@.@@@@@...@@@..@@.@@.@@.@@@.@..@..@@@.@...@.@@@.@@.@@@..@.@@@.@@...@@@@@.@@@...@@@.@..@@@@@.@.@@@.@.@@@@@@@@ +@@@..@@@.@@@..@@@.@..@@.@.@@@@@@@@@@@@@@@@@.@@.@.@@@..@..@@.@@@@@@@.@@@.@..@@@@.@@.@.@@@@..@@@@.@.@.@@...@@@@@@@@.@@@..@@@@@@@.@.@@...@@ +..@@@@@@@..@..@@.@..@@.@.@@@.@....@..@@.@@.@@@@.@@@@@.@@@@@@@@@@@@@...@@@@@@@.@.@@@@@..@.@@.@@.@.@.@@@.@@.@@..@.@@.@@...@@@@@@.@@@@@@.@. +..@@.@@@.@..@@@.@@@.@..@.@@@@@@.@@@@@@.@@@@..@@@@@@...@@@...@@@@@.@@@.@@..@@@@@.@..@@.@....@..@.@.@@...@@@.@@..@.@@@...@.@@@@@@@@@..@... +.@@.@@...@..@@@.@@@@.@@@@.@.@@@@@..@@@@@@.@@@@.@..@@@@@@@@...@@@@@.@.@@.@@.@@@@....@.@..@@@@.@@@..@@@.@.@.@..@@@@.@@@@@@@@...@@.@@@@@@@. +.@@.@@@@@@.@@@@@@.@@@.@@@.@@@..@....@@@@@.@@.@@...@@@.@@@@@@@@...@..@@@.@.@@@@@@..@@@..@@@@@@@@@..@@.@@@....@.@@@@@@.@@@.@..@.@@@..@..@@ +@@.@.@.@@@.@.@@...@.@@@.@@@@@@@@..@@..@@@@@.@@.@.@.@@@@@.@@...@@@@@@@@@@@@..@@.@@@.@@@.@@@@.@@@@@@.@@@@.@..@@@.@@.@..@@@@@.@.@...@@@@@@@ +.@.@@.@@@.@..@@@@..@@.@@@..@.@.@.@.@@.@@.@.@@@@@@@@.@.@.@.@@@.@.@.@...@@@@@@@@.@.@@@..@@@@@@@@@@@@@@@@..@@@...@@...@@@@@@@@@@@@@@@@....@ +.@..@@.@@@.@@.@@@.@@@@@@.@@.@@@@..@.@@@.@@.@.@@@@.@@.@@@@..@...@@@@..@@...@@.@@@..@@@@.@@@@.@@@@.@.@@@.@@.@@@..@..@..@@@@.@.@.@.@@@..@@@ +@@@@@@@@@.@@@@@.@@..@@@@@..@@@@@@@..@.@@@@.@.@@.@@.@...@.@.@@.@@.@@.@....@.@@@.@@....@@..@.@@@@@@@.@.@@@@@...@@..@@@.@@@.@.@@@@@@@@@@@.. +@@.@@..@@@@.@@@@@.@@@@.@.@.@...@@@.@@.@@.@..@@.@.@..@@.@@@.@@@@.@...@.@...@@.@.@@@@@@@@@.@.@@.@@.@@@@@.@@@@...@..@.@@.@..@.@@@@..@.@..@@ +..@@.@@.@@@@@@@@@@.@@@@@..@.@.@@@....@@.@@@@.@@.....@..@..@@..@.@@@@@@@@@....@@@@.@.@@.@@@@@@.@@@.@@.@@@@.@.@.@@.@@@@...@@...@.@.@@@.@@. +...@@@@@@@@.@...@@@.@..@@@@@@.@@@@@@...@.@@@@...@@@.@@@@...@@.@.@@.@@.@@@@@@@@@@@..@@@@.@@@@@..@..@@..@@@..@@@@@..@@@@.@....@@.@@....... +.@.....@....@@@@.@@..@@@@@@.@@.@..@.@@@.@@...@@@@@..@@@@..@@.@@@....@@@@@@@@@@@..@@@@...@@.@@.@@@@.@@@..@@@@@@@.@.@...@.@.@@@@.@@..@@@.@ +..@@..@@@@@@.@.@@@.@@@@@...@@@@@@.@@.@@.@@@@@.@@.@@.@@..@..@.@.@@..@@..@@.@@@@.@@@@@@@.@@@@@@@..@@@@@@.@......@.@@.@.@@@@..@...@@@@.@@@@ +.@..@@...@@@...@@@@@..@.@@.@@..@@...@@@.@@.@..@.@@.@.@@@.@@@..@.@@@.@@.@.@@@@@.@@@.@....@@@..@@.@@@@.@.@@.@@..@.@@@@@@.@....@@@..@@@@@@@ +.@..@@.@@@@..@@.@.@.@@.....@@@.@@@@.@@@.@@@....@@@..@@..@...@@@@.@@@..@@@.@@@@..@@@.@.@@@@@@@@@.@.@@@@.@@.@.@@.@.@@@@@@.@.@@@.@..@.@@.@. +.@@@..@@@@@@@.@..@@...@@@.@.@@@@.@@.@@@@.@.@.@..@@..@.@@.@....@.@..@@@......@.@@.@@.@.@@.@@@@@@@.@@.@@@.@@@.@.@@.....@@..@.@@..@@...@.@. +@@@@.@.@.@....@.@..@@.@@.@@@@@.@.@@@@.@@@@@........@@@.@@..@@.@@@@@.@.@@@.@@.@@@@@..@@@...@...@@@@@@@@.@@@@@.@@..@@@@@@...@@.@@@.@@@@.@@ +@@.@@@@@.@@...@@.@.@@..@.@@.@@@@@.@.@@@@..@@@@@@@..@@.@..@..@@.@.....@@@@..@@@@@..@@@@..@.@.@@@@@@@@@@@@@@@@@@@@@...@..@@@@@.@@@@.@@@@@@ +@@.....@@@..@.@@.@@@@.@@@@.@@.@.@..@.....@@@.@@@..@@...@..@@@@@@...@.@@@.@@@@.@@@@@@@...@@@.@.@.@@@@@@@@@@..@..@@.@@@@@.@@@..@...@.@@.@@ +.@@.@@.@@@@@@@@@@@@@@@@@@@....@.@.@@@..@..@@.@@.@@..@.@@@.@@@.@@@@...@@@@....@..@@@..@@..@@@@.@@@@@@@@@@@.@@.@..@@.@..@@.@@@@@.@@@.@@.@@ +@@@@@@.@@@@@@@@.@...@@@.@.@.@@...@.@.@.@@.....@.@.@@@.@...@.@...@@.@@@@@.@@@@.@@@.@..@.@.@@@@.@@@@@.@@@@...@@.@.@@@@.@...@.@@.@@@@.@@@@@ +@.@@..@@@@.@@@.@.@@@..@..@@@@@@.@@@@.@.@.@@..@@@..@@..@@@@@@@...@...@@@@.@@@@@..@@@@.@@@.@@@..@@@@.@.@@@@@.@@@@@@@.@@@.@@..@@@@.@@.@...@ +@@..@..@.@.@..@@@@.@.@@.@@@@@.@@.@......@..@@@.@@@@...@.@.@.@@@@@@@@@@@@@..@.@...@@@@@.@@.@@@@@.@@@@@@.@@@@@.@.@@@.@@..@@@@@.@@@@.@.@@.. +@.@..@.@.@...@@.@@.@@.@.@.@@...@@.@@@.@@@.@@.@@.@@@@.@.@..@@@@..@@@@.@@@@.@.@@@@@.@@.@@.@@@.@@.@@.@.@.@@.@@@@@.@...@@..@@..@@.@...@@.@@. +..@@@..@.@@@@@@@@@.@@@@@@@@@...@@@.@@@@@.@@..@...@.@@@@..@..@@.@@.@@@.@@@.@.@.@.@@.@@.@@.@@@@..@@.@@@@@.@@...@.@@..@..@...@..@@@@..@@@@@ +..@@.@..@.@@@..@..@@@@@@.@.@@@@@@@@@@..@@@..@@@.@@@@.@.@@.@@@..@.@.@.@@@.@@@.@@@@@@..@@.@@..@.@@@@@...@@.@..@.@@@@@.@@@@.@@@@.@.@@.@.@.@ +.@.@..@@.@.@@@@@@@.@@.....@@..@..@@@@@@@..@@.@@.@@...@@@@.@@@@.@@@@@.@.@@.@.@..@.@@..@@.@@.@...@@@@@.@@@@@@.@@@@@@@@....@@@.@@@.@@@.@.@. +@.@.@..@@.@@..@@...@.@...@.@@..@@@@.@@@.@@@@@.@..@@@@@..@@@.@..@@@..@@@@@@@@.@@@@@@@.@.@@@@@@.@@.@@....@.@..@.@@.@.@@@..@@@@..@.@..@@@@@ +@@@@@@...@@.@..@@@@@@@@@.@@.@.@@@.@@.@@@@@.@@..@@.@@@@.@.@.@@..@.@@@@@....@@.@@.@@.@@.@..@@@@@.@@@..@..@@@.@@@@@@..@@.@@.@.@@@@@@@.@..@. +@@@@..@@.@@@@@.@@@@.@..@@@.@@@@@@.@..@@@@@@@.@@@@@@@@..@.@@@@@..@@@.@@@@@@.@@@.@.@@@..@..@@.@@.@@.@...@.@@@@@.@.@.@..@@@@.@@.@.@@@@@@@.. \ No newline at end of file diff --git a/src/main/resources/day4/input_example.txt b/src/main/resources/day4/input_example.txt new file mode 100644 index 0000000..9ad769d --- /dev/null +++ b/src/main/resources/day4/input_example.txt @@ -0,0 +1,10 @@ +..@@.@@@@. +@@@.@.@.@@ +@@@@@.@.@@ +@.@@@@..@. +@@.@@@@.@@ +.@@@@@@@.@ +.@.@.@.@@@ +@.@@@.@@@@ +.@@@@@@@@. +@.@.@@@.@. \ No newline at end of file diff --git a/src/main/resources/five/input.txt b/src/main/resources/day5/input.txt similarity index 100% rename from src/main/resources/five/input.txt rename to src/main/resources/day5/input.txt diff --git a/src/main/resources/five/input_example.txt b/src/main/resources/day5/input_example.txt similarity index 100% rename from src/main/resources/five/input_example.txt rename to src/main/resources/day5/input_example.txt