From a84c2cf1b6502dc671409811199b1b5aa2b9d673 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Tue, 1 Jul 2025 13:18:06 -0700 Subject: Fix prepend util --- u/leftpadesque/prepend.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/u/leftpadesque/prepend.ts b/u/leftpadesque/prepend.ts index d80f6b6..1819536 100644 --- a/u/leftpadesque/prepend.ts +++ b/u/leftpadesque/prepend.ts @@ -2,4 +2,4 @@ export const prependWith = (arr: string[], prep: string) => Array(arr.length * 2) .fill(0) .map((_, i) => i % 2 === 0) - .map((isPrep, i) => (isPrep ? prep : arr[i]!)); + .map((isPrep, i) => (isPrep ? prep : arr[Math.floor(i / 2)]!)); -- cgit v1.2.3-70-g09d2