solve 33 in uiua (fast)
This commit is contained in:
10
33/main.ua
Normal file
10
33/main.ua
Normal file
@@ -0,0 +1,10 @@
|
||||
# Experimental!
|
||||
# project euler 33
|
||||
/÷⍉ ⧅>2 +1⇡9 # single digit fractions
|
||||
⧅>2 +10⇡90 # combinations 10-100
|
||||
▽⤚(˜∊/÷⍉) # fractions that simplify
|
||||
▽⊸≡/(=3⧻◴⊂∩⊥₁₀) # fractions that cancel
|
||||
Magic ← =⊙÷◡(/÷⊡⊣⊚¬⊙⍉⊙⊟:↻⊙:/↥◡(∩⌟=⊸↻1)∩⊥₁₀)
|
||||
▽⊸≡/Magic
|
||||
▽⊸≡/(¬↥∩/↥∩=₀∩⊥₁₀) # non-trivial
|
||||
⊢÷⊸/∨ /× # reduce the fraction
|
||||
Reference in New Issue
Block a user