Skip to content

Commit

Permalink
CI: speedup example solutions (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored Dec 30, 2024
1 parent 690e6cb commit 3eb3549
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
15 changes: 5 additions & 10 deletions exercises/practice/palindrome-products/.meta/example.ua
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
IsPalindrome ← ≍⇌.°⋕
Products! ← (
Palindrome! ↚ (
⍤"invalid range"◡≥
⍜(-|⇡+1)
⧅≤2
⊸(≡/×)
≡⊂∩▽⟜:≡IsPalindrome.
▽⊸(¬±⊛≡⊢)^0⍆
◴⟜≡⊂⊸≡/×⧅₂≤ ⍜-⇡⊙+₁
▽=≡⊢,/^0 ⍆▽=⊸≡⇌⊸°⋕
)

Smallest ← Products!∘
Largest ← Products!⇌
Smallest ← Palindrome!↧
Largest ← Palindrome!↥
4 changes: 1 addition & 3 deletions exercises/practice/pangram/.meta/example.ua
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Alphabet ← "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Letters ← |1 ⍆▽(×⊃(≥@A)(≤@Z)) .
IsPangram ← |1 ≍ Alphabet ◴ Letters ⌵
IsPangram ← =26⧻◴▽±.⌵
8 changes: 4 additions & 4 deletions exercises/practice/perfect-numbers/.meta/example.ua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Validate ← |1.0 ⍤ "number must be positive" >0
Factors ← |1 ▽:⟜(=0◿)⊸(↘1⇡)
AliquotSum ← |1 /+ Factors
ClassifyNumber ← |1 ⨬("abundant"|"perfect"|"deficient") +1±-⊸AliquotSum Validate .
Check ↚ ⍤"number must be positive">0
Aliquot ↚ -⟜⍜°/×(÷∩-₁⤙ⁿ+₁°▽) # 𝜎₂(n)-n
Type ↚ °□⊡⊓±{"perfect""abundant""deficient"}
ClassifyNumber ← Type-⟜Aliquot⟜Check

0 comments on commit 3eb3549

Please sign in to comment.