From 7223098285c72e0f96dead96f44264f0eb44de34 Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Tue, 7 Oct 2025 09:03:10 +0200 Subject: [PATCH] 92/uiua: even faster with chunked threading and memoization --- 92/main.ua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/92/main.ua b/92/main.ua index c599e04..d359978 100644 --- a/92/main.ua +++ b/92/main.ua @@ -1,7 +1,5 @@ -# next number in chain -N ← /+⍉°√⊥10 +N ← memo(/+⍉°√⊥10) # memoize, because we get many repeated 1s -⍜-⇡1 1e7 -⍥N10 # the longest 1-chain is less than 10 --⊙1e7 ⧻⊚=1 # count 1s to subtract from 1e7 --1 # there are 999999 nums, because no 0 +°△ 1e4_1e3 # chunk the input +wait≡pool⍥₁₀N # thread each chunk of size 1e3 +-⊃(⧻⊚=1|-₁⧻♭)