OBBM6KG6S2PCXM7AWP7HO7ZII4RZ6S4Y7KK5CFYKJ2T2LPL6OO6QC
WXM73CW55QMPDEUVONZY3FFHRWJFCU2EBRLL5YGNNRJUSTMZMEYAC
d, err := parseInput("input.txt")
d, err := parseInput("input.test")
s := seen{} for len(s) < len(road)*len(road[0]) { road.update(s, d, road.getLowest(s))
s := seen{}
for len(s) < len(road)*len(road[0]) {
road.update(s, d, road.getLowest(s))
opts := seen{point{0, 1}: true, point{1, 0}: true} for len(opts) > 0 { next := road.getLowest(opts) road.update(d, next, opts)
opts := seen{point{0, 1}: true, point{1, 0}: true}
for len(opts) > 0 {
next := road.getLowest(opts)
road.update(d, next, opts)
func (r distance) update(s seen, dist distance, p point) { s[p] = true
func (r distance) update(s seen, dist distance, p point) {
s[p] = true
func (r distance) update(dist distance, p point, opts seen) { delete(opts, p)
func (r distance) update(dist distance, p point, opts seen) {
delete(opts, p)
opts[point{diffrow, diffcol}] = true
func (r distance) getLowest(s seen) point {
func (r distance) getLowest(opts seen) point {
for row := 0; row < len(r); row++ { for col := 0; col < len(r[0]); col++ { if s[point{row, col}] { continue } if r[row][col] < min { min = r[row][col] ret = point{row, col} }
for row := 0; row < len(r); row++ {
for col := 0; col < len(r[0]); col++ {
if s[point{row, col}] {
continue
}
if r[row][col] < min {
min = r[row][col]
ret = point{row, col}
for o := range opts { if r[o[0]][o[1]] < min { ret = o min = r[o[0]][o[1]]
for o := range opts {
if r[o[0]][o[1]] < min {
ret = o
min = r[o[0]][o[1]]