part2 (1509B)
1--- Part Two --- 2 3After reviewing the available paths, you realize you might have time to visit a single small cave 4[1m[97mtwice[0m. Specifically, big caves can be visited any number of times, a single small cave can be 5visited at most twice, and the remaining small caves can be visited at most once. However, the caves 6named start and end can only be visited [1m[97mexactly once each[0m: once you leave the start cave, you may 7not return to it, and once you reach the end cave, the path must end immediately. 8 9Now, the 36 possible paths through the first example above are: 10 11start,A,b,A,b,A,c,A,end 12start,A,b,A,b,A,end 13start,A,b,A,b,end 14start,A,b,A,c,A,b,A,end 15start,A,b,A,c,A,b,end 16start,A,b,A,c,A,c,A,end 17start,A,b,A,c,A,end 18start,A,b,A,end 19start,A,b,d,b,A,c,A,end 20start,A,b,d,b,A,end 21start,A,b,d,b,end 22start,A,b,end 23start,A,c,A,b,A,b,A,end 24start,A,c,A,b,A,b,end 25start,A,c,A,b,A,c,A,end 26start,A,c,A,b,A,end 27start,A,c,A,b,d,b,A,end 28start,A,c,A,b,d,b,end 29start,A,c,A,b,end 30start,A,c,A,c,A,b,A,end 31start,A,c,A,c,A,b,end 32start,A,c,A,c,A,end 33start,A,c,A,end 34start,A,end 35start,b,A,b,A,c,A,end 36start,b,A,b,A,end 37start,b,A,b,end 38start,b,A,c,A,b,A,end 39start,b,A,c,A,b,end 40start,b,A,c,A,c,A,end 41start,b,A,c,A,end 42start,b,A,end 43start,b,d,b,A,c,A,end 44start,b,d,b,A,end 45start,b,d,b,end 46start,b,end 47 48The slightly larger example above now has 103 paths through it, and the even larger example now has 493509 paths through it. 50 51Given these new rules, [1m[97mhow many paths through this cave system are there?[0m 52 53