File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ namespace AdventOfCode.Y2025.Day07;
66class Solution : Solver {
77
88 public object PartOne ( string input ) => RunManifold ( input ) . splits ;
9+
910 public object PartTwo ( string input ) => RunManifold ( input ) . timelines ;
11+
1012 public ( int splits , long timelines ) RunManifold ( string input ) {
1113 // Dynamic programming over the grid:
1214 //
@@ -20,18 +22,18 @@ class Solution : Solver {
2022 var lines = input . Split ( "\n " ) . Select ( line => line . ToCharArray ( ) ) . ToArray ( ) ;
2123 var crow = lines . Length ;
2224 var ccol = lines [ 0 ] . Length ;
23-
2425 var splits = 0 ;
2526 var timelines = new long [ ccol ] ;
27+
2628 for ( int irow = 0 ; irow < crow ; irow ++ ) {
2729 var nextTimelines = new long [ ccol ] ;
2830 for ( var icol = 0 ; icol < ccol ; icol ++ ) {
29- if ( lines [ irow ] [ icol ] == '^' ) {
31+ if ( lines [ irow ] [ icol ] == 'S' ) {
32+ nextTimelines [ icol ] = 1 ;
33+ } else if ( lines [ irow ] [ icol ] == '^' ) {
3034 splits += timelines [ icol ] > 0 ? 1 : 0 ;
3135 nextTimelines [ icol - 1 ] += timelines [ icol ] ;
3236 nextTimelines [ icol + 1 ] += timelines [ icol ] ;
33- } else if ( lines [ irow ] [ icol ] == 'S' ) {
34- nextTimelines [ icol ] = 1 ;
3537 } else {
3638 nextTimelines [ icol ] += timelines [ icol ] ;
3739 }
You can’t perform that action at this time.
0 commit comments