solve 91 in uiua (FAST)
This commit is contained in:
12
main.ua
Normal file
12
main.ua
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user