From a85d7449e270f8e25cba98cce3ff033aae9d7db7 Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Mon, 6 Oct 2025 20:46:44 +0200 Subject: [PATCH] solve 91 in uiua (FAST) --- main.ua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 main.ua diff --git a/main.ua b/main.ua new file mode 100644 index 0000000..4b9a4bc --- /dev/null +++ b/main.ua @@ -0,0 +1,12 @@ +# project euler 91 +50 +⍜-⇡0+1 # 0, 1, ... 50 +♭˙⊞ℂ # int coords as complex nums +⧅>2↘1 # without (0, 0), take 2 coords +/( # vv for each coord pair vv + ⊟₃◡- # - make tuple (P, Q, P-Q) + +∩°√°ℂ # - calculate P^2, Q^2, (P-Q)^2 + ⟜(+⊸↻1) # - sum all combinations + /↥=↻¯1 # - sum equal to other coord sq len? +)⍉ # ^^ for each coord pair ^^ +⧻⊚ # count such coord pairs