Skip to content

Commit d1b55ea

Browse files
committed
[AoC 2023 Day 3] Solution 1
What a mess.
1 parent 939d5ea commit d1b55ea

File tree

2 files changed

+140
-1
lines changed

2 files changed

+140
-1
lines changed

src/main/kotlin/com/rox/adventofcode/y2022/Day3.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ private fun solutionB(input: String): Any {
130130
val b = rows[i+1].toSet()
131131
val c = rows[i+2].toSet()
132132

133-
134133
val intersection = a.intersect(b).intersect(c)
135134
sum += priorities[intersection.first()] as Int
136135
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
....401.............425.......323......791......697...............963............................................420........................
2+
...*..................................%......#.....*....290.........................492.............656...@953.....................+830.....
3+
..159...........823...33.717.....572.......806...896......-.....335....834......815.............791....*..............776...................
4+
.........-.....#........*.........*..................715..........*.....*........*.....................5...*.....................688........
5+
....=..=..573..............212.......553.632....622....*.......260....29.........692.129....727...........290.........%32.....%...*..441....
6+
.791..998..............................*............531.......................84.......*..../.......506%......=............240..831..*......
7+
.....................321.586........447...&.-276.21......@..........12.......&.......-..333...................619..94................982....
8+
..........@...........#..*..............525.......*...183............*............407.......23.........%............&......846..............
9+
....97..686.............89.....................-..494..............875....*607.............*.......239.407..................%.......529.....
10+
.....+.........815..703............208.=555.856...........@............133........................*..........672...501........898#...*......
11+
...............*.......*...659.......*....................183..............528.......614.......4....................................39......
12+
...602..........804..313....*.......480..............602.............354......*877................832@.....140...$...........707.......222..
13+
...*....999.................23.264..............516.....*.......-....*....................................*.....722......24....*........*...
14+
436....+................./......./..........765*......37.....843....218..........852*68....290............410...........*.....539....896....
15+
.........../...#........907............587...............&................149...............*.......*..............#780..707................
16+
........349....603.598....................-....203.....178.......431......./...............152......571....926.750.............127..........
17+
.............@........*176.283...................*...%......642......../......20..............................*.........@.............534...
18+
...749..../.194..............*.......337.395*....682.429.=...#..........186.....*.........682..../......498..........%.8.............*......
19+
....*..324..........893*...878......*........659..........65....671.189.......641...........+.859.........$.......149....648........53.+....
20+
...776......$.....................667.................432...........*..............697............282.901...................*889........471.
21+
............103............../........-..................-...748&.257.............&...........739*....*......491*543................997.....
22+
.........2.........813*.....278..316.333.....296.142.+...................673.%....../.....+.........490...................790........*......
23+
......@.*.......................*...............*....643.464............*....25....108..807..179.........931.......289..........365...522...
24+
....367.250.927../.............754.........14...............*.+..........23...................*......&.....*..%..........323................
25+
................939...644..............791..*.551....35...937..806...............&.............536.930...703...565......*...............*640
26+
534$.................*.........$..448.....=......*...................707*658.....33....920..74.....................844................36....
27+
.......572....672...875......770.+................380.............52......................*.......-....251............%........*909......677
28+
.......*.......=........................658.889.........882.....=......................534..*..291...%....*.................289.............
29+
.212......993..............438./..........*....@..532......*586.163....213...307...........167.....981.700..................................
30+
....*.....*..................-..12...611...196.......*309.....................+.......*685............................403....243..+385......
31+
59...428..14...22.747....990............*........575...............................247.....985....&..................*.......*..............
32+
.................*........%...539.......416.712.....*2..408.......%....................999.......275......738.....715......670..............
33+
..357........653..............*....374..........285................785.........384......*.............277*........................765.137...
34+
...@..........*..@632......361.......=..............35.........329..............................=858..............798.................*.....
35+
......................216*.......459..................*..........&........479.....255......302......................*.530.........269..453..
36+
............./.573........153.....*........#.......462...%..........45......+.122*............*672....545........157.....*862.....*.........
37+
820....%...977.+...................726...790.199.........631....308..................755..............*...460..................643....#237..
38+
.......229.............727..425............../..........................228........#..$...............385....&...........695................
39+
...................978.*....*....................700....*.........256..@.........625......311.170...+................642*...................
40+
.492.....983.........-.577.743..................*....267.521........%....479.......................696.980......................*...........
41+
....*820.#....................................236.................*......*...856.............137...........489......409........177..450.....
42+
974.........479.$......182..456......./.............*755..617..333.849.........*...............*..........*..........=...-...........*......
43+
...+..........*..83.#....@.=...........893.......610.........*.................727....6*..488.839...449..541../97......560.........449......
44+
............208......168......971..........................547..........559............................=...........237...................641
45+
.......336...................*....563..993.911.=......853................*...............391...@572.................*.......*......614..*...
46+
........$...........579.....810....-......*....480....*......649.138..410..201..604........*..............450#.....485...124.841..*......790
47+
..399...........928.............67..................#..295......*............*...#....333...83...#111.............................635.......
48+
...=........./.....*..807...529..*......642#......603......704.........@....599......&.................=....................................
49+
..............233.618..../........114........566......100..*.....423.26...............................168................555$..........#625.
50+
.....608*372..................543..........*.*............4.....*.......+374.......436*...................680.135....................*......
51+
.................................@...385.309..111......69....991..127........693#......985....25..856*96.+.......*860..........%..278.160...
52+
.......351.......495=.772..............*...............*...........*...........................@............569...............905...........
53+
........................*.$402........640.*.............366.........350...623&...250.............446*341.....=.........................292..
54+
....#..*...595.289...347..........75.......844......307..........................*....585.....*..................766+...................*...
55+
.148..906.....*..........232.449...*...........................................326..$...-..102.595.....406............-...........650....682
56+
..........619...23........$...*.....138.893.......890...79....53.........118........966................+..............233............*......
57+
.........*......../..........62..........*........*....*.............@..*....................245...........-....806.........98........318...
58+
....534+.264..993...420.................675..77..659..263..........615.405...............=..*......%..75...614.*..................4.........
59+
...............*..............421.........................834*287.......................813..651.902...*........134.....$...........334.....
60+
....631....=..443........................352..........941...............317.......*286...............562.855............690....387.....*....
61+
.27...$.430......................89....-....*90...&......%..........155.......899.......%59....*986.................775..............25.....
62+
...*....................-.....+...*...952.........62.........478...........&...../..........694.........775.....640..$......................
63+
....102..........+197....109.270.453.....................................641.......123..........573....*.......=............880.403+........
64+
.........87.186..........................709.+219........224.726...882.............*...868..203*....732............928*607..*...............
65+
..819....*..*.............*....81........*....................-../..%...+..........700.=.......................149............*....438..=...
66+
....#.875..223.106.........646......%.....519...579.............38.....883.626@....................149..........=..........205.272./....480.
67+
.......................965.........332.........*......221.292...........................594..945......*931..365....814*214..................
68+
..228*....29............*....79...........+.....811.....*..*..592..........681.............*....#.427........*................170..58.......
69+
......563...*........817..93*...+60..507...898........796.942...*..=335.......@...490....488.......-......974....817...........*....+.......
70+
...........519..&...................*..........948.............454......184.........*.........=.......................409......947..........
71+
...............272..........257....712............+.@.....338..............*381...824..923..756.............971*181....=....+......430......
72+
....228.............709.......&......................685.....*..597....135......+.....*..........+......471..................452..*......923
73+
....*..................#...........271.....................167.*.........*.......325.935..........224......*.....749&...-..........587......
74+
..464.../199..$..........50...........*..794..........36.......733....................................@....414...........605................
75+
...............765.%.......=.215*717........*715....................210......845.......................643........66...........*908.........
76+
.........215........761............................544....781...390*.....576..*....869..781....517................*.....356.664.......=.....
77+
..............316...........235/...............715*.....-....*.............*..130..........*..@..........&.........564.*...............89...
78+
...................................&....169...........353....390....57.71.847...........716.........466..516..651......447..................
79+
.......459..................101.379.....*......324...................#.#............943..............*...........%.........$625.../...586...
80+
........*.....173...................198..306...*....313........51............629...*..........-958..228.178.......................967.......
81+
......714...@.........206.......934*.........109...........*.........../......*....832...................*........934.....921..........897..
82+
...........487............700......................*507..415....349%...179...961................437.......489.......*............../...*....
83+
.................*440.952*................667...533.....................................359.618....*927.........................968...412...
84+
...........-..778..................667.....@..........764..401.........279.......#.748.....*................534*.....444....................
85+
...835..779......../.....443.........*.........................53/......=......774......=....784...204..385.....929..........+...861........
86+
......%..........74..947*.....187&.874..........&.........................545........752.......$....$...*..................308.....*..284...
87+
........#.................190...........445$..784...51*226...................*............*245..........435.......=...200..........88.*.....
88+
640.....310...&...........*......296..........................................107......943..........244...........662......=..440+....302...
89+
...*..........67........381..............856....349...........790*...911........................901...*......733........844.................
90+
.327..............885........169.....419........*.....62..........70..@..664...........=...422%...*....617.....*....................230*....
91+
...........916...@.............................95....@.....+.........................355.........104...........149......................569.
92+
.............*.........................230.../..............350..............................432.....710............=.........=.............
93+
..925..545..634.....@..297*933...........*....839...33...........34.....162.......577..248.....#...........814...524..........790......9/...
94+
...*...............66....................421............606+..*../.......&.........*....&..129..............=......................529......
95+
659..........253...........$504.......*......................379....&........./..860......+..............&...............%.....658*....310..
96+
........208...*........................354..........................647......326...............911.....503.......11.......293...............
97+
....*.....&.617..511.........885.906......................166/......................589..........*..........749....*931..........915........
98+
.852.908........................*................../........................297.470*........#628..269...613......#................*.........
99+
.........................716.................689...460...737*502...510.............../...........................778.......373..734.....+...
100+
..520=.........../.....*....*226........326.....+.................+............971...362........800$..904.303.........*874..........=..548..
101+
............554.889.720.854......808.....*..258............284*........639/...*...........................*........603.............839......
102+
...........*........................*690.71..*.........314.....795.86.........53.................786%...134...................890*..........
103+
663.....225...%........513...................951..........*........*...............275.995...764.....................=............30........
104+
...*...........353....*...........%......................468.....87..225........31..=.....%.=......../.......886.....84.....................
105+
..694......166........243........380...275..287..............261.....@.....888....*............162...278.......&..........351.534........197
106+
........$.......209.-......261...........*.......876.....15.....*.........*........712.....870...*.......897.....46...........#.............
107+
......450.........%..463.....%.679....119.....=.*....@...@.........871...408..995*...........*...922.+..........*...66.466..................
108+
..............803.........................$.250...493...............&.............356.519.552........737.......153....*.............+.......
109+
......982........*.....................540...................641.......................*......&....................................851../...
110+
..............638..............=.306....................+938..@................*520....511.174......*..........-......*503...832.........219
111+
.292..239...................775..*......334..../582...................173...859..................238.678......117..429.......%...708.534....
112+
........*........240....491.....546...................+................*.............%....498.............................55........*.....74
113+
.816.....406.......*...&..............181...........765.......776....+..636...&337...264..*............*716..$908...........*...............
114+
...................860....................980...................$..323....................163.......851............*.......396......501.....
115+
...-..20*197................722..........*...............................&.....408..............109.......794*155..590........./....$.......
116+
.482...........257..........*............999./850.........482..........933........*.*982...../.....*..........................826.......908.
117+
.......%597......@..345.329..172.....295...........349....*.....=527........174.727........645...167......@..........*......................
118+
.....................*.....+..........$.............*....725...............*............$............+.447..723...346.759............967....
119+
............638..............................589.....................................=..312..+....951..........=..........809*..........#...
120+
.............@............325..........322.........&......................508......359......768........8..&.........992.....................
121+
.783.32...................*............*.........656.............98*178.....%.....................74*.....2...410&....@............+........
122+
...*...*..54*525...112..720...66......641.+280.......................................................467.......................580..348.....
123+
..699.673......................................491..869............#......171..............98............473......%..............$..........
124+
........................%.....214.......303$......#..%.......191.852..560*.......835..550...$.150.........#........291.......240............
125+
.......579...982.........713....*...536.......................+...................*....#........$..840.......43................*............
126+
......$.........*....*.......606......+....48...........993.......838*744.880....969........@........*......*....*726..........168...&......
127+
...............395.579............340......*........386.=...420..............*........833..835........257...842....................810...635
128+
......#......................%...........983...632.@........*........-...%..157...193*...........................@..137....209..............
129+
.....819.....................278..377........................578...195..230........................$......586.985...............263.417.....
130+
................592....../............*......../.............................922.......350........138.156*............698...78*.........$571
131+
....................405/..573.764....257.@940...34.977$..441....304.............*.....*................................*.......93..600......
132+
...643....675...262..........................................................993.....556...........314........278.258.322............*......
133+
...*.........*.....&................/.....................222.........959................@..121.......*...930.......#.......170*462.....588.
134+
384....+..19.863..............407=.283.........972...340....#....427*....*737...........558...%.....91......*...........................=...
135+
.....812...@.........298..563....................*......*............506..........845......................634...&............624+...&......
136+
.....................*.....=.....*.............492.563...950..827*...............+....................968......652..................49......
137+
.730.........498..382.........399.......824.........&...................390.630........248...........*.......-......448......-..............
138+
................*......333..........832*.....#...............$...565.....*...............*............701..564.........*.115..718.......313.
139+
.960...*965....993......*.....*..............604..........730...*..................234&..662.....+..............=69.930...*.......967*......
140+
.....30..............355...978...........67.........419........239..........732...............645..........................484........664...

0 commit comments

Comments
 (0)