Dyalog APL Problem Solving Competition - My Solutions
Table of Contents
- 2023 p1: Elimination - APL Competition
- 2023 p3: Caesar Salad - APL Competition
- 2023 p4: Like a Version - APL Competition
- 2023 p5: Risky Business - APL Competition
- 2023 p6: Key:Value - APL Competition
- 2022 P1: Counting DNA Nucleotides? - APL Practice Problems
- 2022 P2: Attack of the Mutations! - APL Practice Problems
- 2013 P1: Seems a Bit Odd To Me - APL Practice Problems
- 2013 P2: Making The Grade - APL Practice Problems
- 2013 P3: What Is In a Word - APL Practice Problems
- 2013 P4: Keeping Things In Balance - APL Practice Problems
- 2013 P5: Identity Crisis - APL Practice Problems
- 2013 P6: Home On The Range - APL Practice Problems
- 2013 P7: Float Your Boat - APL Practice Problems
- 2013 P8: Go Forth And Multiply - APL Practice Problems
- 2013 P9: It Is a Moving Experience - APL Practice Problems
- Resources
2023 p1: Elimination - APL Competition
{(⍵=⌈\⍵)/⍵}
2023 p3: Caesar Salad - APL Competition
{(⍺⌽⎕A,' ')[⎕A⍳⍵]}
2023 p4: Like a Version - APL Competition
{×+/(⍺(×-)⍵)× ⌽10*⍳3}
2023 p5: Risky Business - APL Competition
{n ← (≢⍺)⌊(≢⍵) ⋄ s←+/(n↑⍺)≤(n↑⍵) ⋄ s,n-s}
2023 p6: Key:Value - APL Competition
{p←{(⍺≠⍵)⊆⍵} ⋄ ↑⊢(2⊃⍺)p¨(⊃⍺)p ⍵} {p←≠⊆⊢ ⋄ ↑⊢(2⊃⍺)p¨(⊃⍺)p ⍵}
2022 P1: Counting DNA Nucleotides? - APL Practice Problems
{{(≢⍵)-1}⌸'ACGT',⍵}
2022 P2: Attack of the Mutations! - APL Practice Problems
{+/⍺≠⍵} ⍝ or (+/⊣≠⊢)
2013 P1: Seems a Bit Odd To Me - APL Practice Problems
{⎕IO ← 0 ⋄ run←⍳⍵×2 ⋄ (2|run)/run} {run←⍳2×⍵ ⋄ (2|run)/run} {⍸2|⍳2×⍵}
2013 P2: Making The Grade - APL Practice Problems
{100×(+/65≤⍵)÷≢⍵}
2013 P3: What Is In a Word - APL Practice Problems
{≢(' '≠⍵)⊆'',⍵} {≢(' '≠⍵)⊆,⍵}
2013 P4: Keeping Things In Balance - APL Practice Problems
{m ← (1 ¯1 0)[('()'⍳' ',⍵)] ⋄ ∧/0=(+/⊃¯1={ ⍺, ⍺ + ⍵}/m)(+/m)} {m ← (1 ¯1 0)['()'⍳' ',⍵] ⋄ ∧/0=(+/¯1=+\m)(+/m)} {m ← (1 ¯1 0)['()'⍳' ',⍵] ⋄ ^/(0≤+\m)∧(0=+/m)}
2013 P6: Home On The Range - APL Practice Problems
{⌈/,⍵-⌊/,⍵} (⌈/-⌊/),
2013 P7: Float Your Boat - APL Practice Problems
{(0≠1|⍵)/⍵}
2013 P9: It Is a Moving Experience - APL Practice Problems
{r←,{⍬(⊣⍣(⊃⍺≠0))(+/⍵÷≢⍵)}⌺⍺⊢⍵ ⋄ (r≠0)/r}