solve 52 in uiua
This commit is contained in:
11
52/main.ua
Normal file
11
52/main.ua
Normal file
@@ -0,0 +1,11 @@
|
||||
# project euler 52
|
||||
# check n, 2n, ..., 6n to see if they
|
||||
# are all permutations of the same digits.
|
||||
# int ? bool
|
||||
c ← (
|
||||
×+1⇡6 # get multiples n, 2n, ...
|
||||
⍚(⍆°⋕) # sort digits
|
||||
/↧⧈₂/≍ # pairwise match digits
|
||||
)
|
||||
|
||||
⍢+₁(¬c)1 # increment n until c(n) = 1
|
||||
Reference in New Issue
Block a user