despair day 4
This commit is contained in:
parent
75d541877d
commit
199303ce82
2 changed files with 208 additions and 0 deletions
140
inputs/04.txt
Normal file
140
inputs/04.txt
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
SAMMSSSSXSAMXMSMASMMSMSSMMSSXMASMAMMAMSSMSMSAXSSXMXMSASXMSAMXSMMXAMXMMSMSSMXSAMXMMASMSMSMMMAXAAXXASXMMXMSSXMASMMSMXAMSMMMMMAMXSASAMXMMXSAMXM
|
||||||
|
SAAXAASAASXAAAAAMAAXMAAAMSAAAXAXMAXMSASAASAXAMAMXMSMMAXMAXAMXXAASMSMMAAXXAASASXSXSAMXSAMXAXMSMSMSMMASAMXMSXXAAMSAMMMSMMMAAMAMAXAMXSAMXMAMMAM
|
||||||
|
SMMMMSMMMMMSMSXSSSSMMMMMMMMSMMASMXXAMXSXMMMMSAMXAMAAMMMAMSSMMSMMSAAXMSSSSMXMAAXSAMXSAMMMMSXXAAAAAAMMMSSMAMMSSMMSASXMAAMSSXSASMMXMASASMAMMMAM
|
||||||
|
SAAXXMASAXAXMMMXAAXASAXXAMXXXXMMASMXMASAMXXAMSXSSSSSMAXAMXXAAAAAMXMMAAAAXXXMMSAMXMMMMMSAAMXSMSMSMSMMAXXMAXMAMAASXMASXSMAMXSASMSSMASXMXSXSSSS
|
||||||
|
SSMSSXASXMXSASAMMMMMAAXSAMXXMASMAMMAMXXXMMMMSMXAAMAAXXSSSMSMMSAXSAXASXMMMMXXSXMSAXAMAMMMSMASAXAMAMAMXSXXSAMASMMSASMMAMMSSMMAMAAMMASXMMMAMAAS
|
||||||
|
XAXXAMXSMXXSAXXSASMSMAMXAMXMMASMXMMSSSMAXMASMMMMMMSMMMAMAMAAXXXSXMMMMAMXMXMMMAASASXMMMXMAMAMAMAMASMMSMMAXMMASAMSMMXMSMAAAXMAMMMSMXXAMAMAMMMM
|
||||||
|
MSMAMMMMAXMMMMSMASAAXAMSSMSXMASMSMAAAASMMSMSAXMASAAAAMASASMSMASMMXAASAMX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MXMXXXSXMXMXMXSXMXXXMAMXMASMSSMSSXMXSXASAMMXAMXMXXAXMXMMMMXMAMXXAXAXAXMAXAASXMMASXMXXASAMMXAAXAMXASMS
|
||||||
|
SSSMSMASAAAXMMMASMSASASMSMAMAMMXSMMXXAMXAMSMMMXMASXMAMMMMMMSXMXSAAAAAMAMXXAMMMMAMXMMMSASMSMSMMASXMSMMAMMMMMMMSMSSMMASMMMMMSMMMMMSMMSSSMSMMAA
|
||||||
|
MAAAXMAMMMMMAAMMMASASASAAMASAMAAMASAMSSSXSAAAXASXSAMXSAAAAMMMAAMAMMMSMASMMXSAASAMAAXXMAMMAAAASASAAAAMASAAAAAAAXXAASAMXAAAAAAAXAAAXAAMAMXAMXM
|
||||||
|
MSMMMMMSAMXSSMSXMMMXMXMMMSMSMSXXSSMXSAMXSSMSMSMSASMMSSMSSSXAXMXSXMASMXMSXXASXMSXMAMSAMXMSXSSXMSSMMMASMSXSSSMSSSSSMMMSXSSSSSSMSMSSSMXSSMSMMAX
|
68
solutions/04.ts
Normal file
68
solutions/04.ts
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
import { solvables } from "../main.ts";
|
||||||
|
|
||||||
|
import type { Solvable } from "../solvable.ts";
|
||||||
|
import { readInput } from "../utils.ts";
|
||||||
|
|
||||||
|
class DayFour implements Solvable {
|
||||||
|
input = readInput('04')
|
||||||
|
|
||||||
|
public part1(): Solvable {
|
||||||
|
|
||||||
|
const transpose = (m: string[][]) => m[0].map((_,i) => m.map(x => x[i]))
|
||||||
|
|
||||||
|
const matrix = this.input.trim().split('\n').map(line => line.split(''))
|
||||||
|
|
||||||
|
const countOccHorizontal = (mat: string[][]) => mat
|
||||||
|
.map(line => line.join('')
|
||||||
|
.matchAll(/(XMAS|SAMX)/g)
|
||||||
|
.map(match => match[0])
|
||||||
|
.toArray().length)
|
||||||
|
.reduce((prev, curr) => prev + curr)
|
||||||
|
|
||||||
|
// b/y = height
|
||||||
|
// a/x = width
|
||||||
|
// start top right
|
||||||
|
|
||||||
|
const getDiagonals = (mat: string[][]) => {
|
||||||
|
let [b,a] = [0, mat[0].length - 1]
|
||||||
|
const lines = []
|
||||||
|
while (b < mat.length) {
|
||||||
|
let [y,x] = [b,a]
|
||||||
|
let line = ''
|
||||||
|
// walk top left of diagonal to bottom right
|
||||||
|
while (x < mat[y].length && y < mat.length - 1) {
|
||||||
|
line += mat[y][x]
|
||||||
|
y++
|
||||||
|
x++
|
||||||
|
}
|
||||||
|
lines.push(line.split(''))
|
||||||
|
|
||||||
|
if (a > 0) {
|
||||||
|
a--
|
||||||
|
} else {
|
||||||
|
b++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lines
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(getDiagonals(matrix.reverse()))
|
||||||
|
|
||||||
|
console.log(transpose(matrix).map(line=> line.join('')))
|
||||||
|
|
||||||
|
const downRight = countOccHorizontal(getDiagonals(matrix))
|
||||||
|
const downLeft = countOccHorizontal(getDiagonals(matrix.reverse()))
|
||||||
|
const horizontal = countOccHorizontal(matrix)
|
||||||
|
const vertical = countOccHorizontal(transpose(matrix))
|
||||||
|
|
||||||
|
console.log(horizontal + vertical + downRight + downLeft)
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
public part2(): Solvable {
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
solvables.push(new DayFour())
|
Loading…
Reference in a new issue