Skip to content

Commit cb9b007

Browse files
committed
Make the Grid class applicable to input lines of different length
1 parent fd6a650 commit cb9b007

File tree

1 file changed

+1
-1
lines changed
  • src/main/kotlin/de/ronny_h/aoc/extensions/grids

1 file changed

+1
-1
lines changed

src/main/kotlin/de/ronny_h/aoc/extensions/grids/Grid.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract class Grid<T>(
5252
*/
5353
constructor(input: List<String>, nullElement: T, overrideElement: T = nullElement) : this(
5454
input.size,
55-
input[0].length,
55+
input.maxOf { it.length },
5656
nullElement,
5757
overrideElement,
5858
emptyList()

0 commit comments

Comments
 (0)