part1 (1656B)
1--- Day 15: Chiton --- 2 3You've almost reached the exit of the cave, but the walls are getting closer together. Your 4submarine can barely still fit, though; the main problem is that the walls of the cave are covered 5in chitons, and it would be best not to bump any of them. 6 7The cavern is large, but has a very low ceiling, restricting your motion to two dimensions. The 8shape of the cavern resembles a square; a quick scan of chiton density produces a map of 9[1m[97mrisk level[0m throughout the cave (your puzzle input). For example: 10 111163751742 121381373672 132136511328 143694931569 157463417111 161319128137 171359912421 183125421639 191293138521 202311944581 21 22You start in the top left position, your destination is the bottom right position, and you cannot 23move diagonally. The number at each position is its [1m[97mrisk level[0m; to determine the total risk of an 24entire path, add up the risk levels of each position you [1m[97menter[0m (that is, don't count the risk level 25of your starting position unless you enter it; leaving it adds no risk to your total). 26 27Your goal is to find a path with the [1m[97mlowest total risk[0m. In this example, a path with the lowest 28total risk is highlighted here: 29 30[1m[97m1[0m163751742 31[1m[97m1[0m381373672 32[1m[97m2136511[0m328 33369493[1m[97m15[0m69 347463417[1m[97m1[0m11 351319128[1m[97m13[0m7 3613599124[1m[97m2[0m1 3731254216[1m[97m3[0m9 3812931385[1m[97m21[0m 39231194458[1m[97m1[0m 40 41The total risk of this path is [1m[97m40[0m (the starting position is never entered, so its risk is not 42counted). 43 44[1m[97mWhat is the lowest total risk of any path from the top left to the bottom right?[0m 45 46