From cc4728c71c53139798ea48d7e9cb92017d0e0cc0 Mon Sep 17 00:00:00 2001 From: "nuo.o" <49533950+nuoxoxo@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:51:47 +0200 Subject: [PATCH] Update Aoc1810.tsx --- src/includes/Aoc1810.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/includes/Aoc1810.tsx b/src/includes/Aoc1810.tsx index 932e995..f8c9eeb 100644 --- a/src/includes/Aoc1810.tsx +++ b/src/includes/Aoc1810.tsx @@ -1,9 +1,5 @@ import { useState, useEffect } from "react" -import { - FetchData, - // LenNStrsFromLine, - // Deepcopy2DArray, -} from "../helpers/Helpers" +import { FetchData } from "../helpers/Helpers" const suffixes = ['alt', '0'] const choice = suffixes[Math.floor(Math.random() * suffixes.length)] @@ -14,6 +10,7 @@ const URL: string = // console.log(choice, URL) var Aoc1810 = () => { + const [lines, setLines] = useState([]) const [images, setImages] = useState([]) @@ -34,6 +31,7 @@ var Aoc1810 = () => { } const Solver = () => { + let res:string[][] = [] let A: number[][] = [] for (let line of lines) { @@ -45,6 +43,7 @@ var Aoc1810 = () => { let i = -1 while (++i < 10700) { // range is hand picked + let hix: number = Math.max(...A.map(([n, , ,]) => n)) let lox: number = Math.min(...A.map(([n, , ,]) => n)) let hiy: number = Math.max(...A.map(([, n, ,]) => n))