part2 (7412B)
1--- Part Two --- 2 3Now that you know how to find low-risk paths in the cave, you can try to find your way out. 4 5The entire cave is actually [1m[97mfive times larger in both dimensions[0m than you thought; the area you 6originally scanned is just one tile in a 5x5 tile area that forms the full map. Your original map 7tile repeats to the right and downward; each time the tile repeats to the right or downward, all of 8its risk levels [1m[97mare 1 higher[0m than the tile immediately up or left of it. However, risk levels above 99 wrap back around to 1. So, if your original map had some position with a risk level of 8, then 10that same position on each of the 25 total tiles would be as follows: 11 128 9 1 2 3 139 1 2 3 4 141 2 3 4 5 152 3 4 5 6 163 4 5 6 7 17 18Each single digit above corresponds to the example position with a value of 8 on the top-left tile. 19Because the full map is actually five times larger in both dimensions, that position appears a total 20of 25 times, once in each duplicated tile, with the values shown above. 21 22Here is the full five-times-as-large version of the first example above, with the original map in 23the top left corner highlighted: 24 25[1m[97m1163751742[0m2274862853338597396444961841755517295286 26[1m[97m1381373672[0m2492484783351359589446246169155735727126 27[1m[97m2136511328[0m3247622439435873354154698446526571955763 28[1m[97m3694931569[0m4715142671582625378269373648937148475914 29[1m[97m7463417111[0m8574528222968563933317967414442817852555 30[1m[97m1319128137[0m2421239248353234135946434524615754563572 31[1m[97m1359912421[0m2461123532357223464346833457545794456865 32[1m[97m3125421639[0m4236532741534764385264587549637569865174 33[1m[97m1293138521[0m2314249632342535174345364628545647573965 34[1m[97m2311944581[0m3422155692453326671356443778246755488935 3522748628533385973964449618417555172952866628316397 3624924847833513595894462461691557357271266846838237 3732476224394358733541546984465265719557637682166874 3847151426715826253782693736489371484759148259586125 3985745282229685639333179674144428178525553928963666 4024212392483532341359464345246157545635726865674683 4124611235323572234643468334575457944568656815567976 4242365327415347643852645875496375698651748671976285 4323142496323425351743453646285456475739656758684176 4434221556924533266713564437782467554889357866599146 4533859739644496184175551729528666283163977739427418 4635135958944624616915573572712668468382377957949348 4743587335415469844652657195576376821668748793277985 4858262537826937364893714847591482595861259361697236 4996856393331796741444281785255539289636664139174777 5035323413594643452461575456357268656746837976785794 5135722346434683345754579445686568155679767926678187 5253476438526458754963756986517486719762859782187396 5334253517434536462854564757396567586841767869795287 5445332667135644377824675548893578665991468977611257 5544961841755517295286662831639777394274188841538529 5646246169155735727126684683823779579493488168151459 5754698446526571955763768216687487932779859814388196 5869373648937148475914825958612593616972361472718347 5917967414442817852555392896366641391747775241285888 6046434524615754563572686567468379767857948187896815 6146833457545794456865681556797679266781878137789298 6264587549637569865174867197628597821873961893298417 6345364628545647573965675868417678697952878971816398 6456443778246755488935786659914689776112579188722368 6555172952866628316397773942741888415385299952649631 6657357271266846838237795794934881681514599279262561 6765719557637682166874879327798598143881961925499217 6871484759148259586125936169723614727183472583829458 6928178525553928963666413917477752412858886352396999 7057545635726865674683797678579481878968159298917926 7157944568656815567976792667818781377892989248891319 7275698651748671976285978218739618932984172914319528 7356475739656758684176786979528789718163989182927419 7467554889357866599146897761125791887223681299833479 75 76Equipped with the full map, you can now find a path from the top left corner to the bottom right 77corner with the lowest total risk: 78 79[1m[97m1[0m1637517422274862853338597396444961841755517295286 80[1m[97m1[0m3813736722492484783351359589446246169155735727126 81[1m[97m2[0m1365113283247622439435873354154698446526571955763 82[1m[97m3[0m6949315694715142671582625378269373648937148475914 83[1m[97m7[0m4634171118574528222968563933317967414442817852555 84[1m[97m1[0m3191281372421239248353234135946434524615754563572 85[1m[97m1[0m3599124212461123532357223464346833457545794456865 86[1m[97m3[0m1254216394236532741534764385264587549637569865174 87[1m[97m1[0m2931385212314249632342535174345364628545647573965 88[1m[97m2[0m3119445813422155692453326671356443778246755488935 89[1m[97m2[0m2748628533385973964449618417555172952866628316397 90[1m[97m2[0m4924847833513595894462461691557357271266846838237 91[1m[97m324[0m76224394358733541546984465265719557637682166874 9247[1m[97m15[0m1426715826253782693736489371484759148259586125 93857[1m[97m4[0m5282229685639333179674144428178525553928963666 94242[1m[97m1[0m2392483532341359464345246157545635726865674683 95246[1m[97m1123532[0m3572234643468334575457944568656815567976 96423653274[1m[97m1[0m5347643852645875496375698651748671976285 97231424963[1m[97m2342[0m5351743453646285456475739656758684176 98342215569245[1m[97m332[0m66713564437782467554889357866599146 9933859739644496[1m[97m1[0m84175551729528666283163977739427418 10035135958944624[1m[97m61[0m6915573572712668468382377957949348 101435873354154698[1m[97m44[0m652657195576376821668748793277985 1025826253782693736[1m[97m4[0m893714847591482595861259361697236 1039685639333179674[1m[97m1[0m444281785255539289636664139174777 1043532341359464345[1m[97m2461[0m575456357268656746837976785794 1053572234643468334575[1m[97m4[0m579445686568155679767926678187 1065347643852645875496[1m[97m3[0m756986517486719762859782187396 1073425351743453646285[1m[97m4564[0m757396567586841767869795287 1084533266713564437782467[1m[97m554[0m8893578665991468977611257 109449618417555172952866628[1m[97m3163[0m9777394274188841538529 110462461691557357271266846838[1m[97m2[0m3779579493488168151459 111546984465265719557637682166[1m[97m8[0m7487932779859814388196 112693736489371484759148259586[1m[97m125[0m93616972361472718347 11317967414442817852555392896366[1m[97m6413[0m91747775241285888 11446434524615754563572686567468379[1m[97m7[0m67857948187896815 11546833457545794456865681556797679[1m[97m26[0m6781878137789298 116645875496375698651748671976285978[1m[97m21[0m873961893298417 1174536462854564757396567586841767869[1m[97m7[0m952878971816398 1185644377824675548893578665991468977[1m[97m6112[0m579188722368 1195517295286662831639777394274188841538[1m[97m5[0m299952649631 1205735727126684683823779579493488168151[1m[97m4[0m599279262561 1216571955763768216687487932779859814388[1m[97m1[0m961925499217 1227148475914825958612593616972361472718[1m[97m34725[0m83829458 12328178525553928963666413917477752412858886[1m[97m3[0m52396999 12457545635726865674683797678579481878968159[1m[97m2[0m98917926 12557944568656815567976792667818781377892989[1m[97m24[0m8891319 126756986517486719762859782187396189329841729[1m[97m1431[0m9528 127564757396567586841767869795287897181639891829[1m[97m2[0m7419 128675548893578665991468977611257918872236812998[1m[97m33479[0m 129 130The total risk of this path is [1m[97m315[0m (the starting position is still never entered, so its risk is not 131counted). 132 133Using the full map, [1m[97mwhat is the lowest total risk of any path from the top left to the bottom 134right?[0m 135 136