24
edits
(Added examples) |
(fix the longest common prefix error) |
||
Line 56: | Line 56: | ||
Example application, to find the longest common prefix: | Example application, to find the longest common prefix: | ||
<source lang="apl"> | <source lang="apl"> | ||
lcp←{(+/(^/⊃=⊢)¨↓⍉↑⍵)↑⊃⍵} | lcp←{(+/^\(^/⊃=⊢)¨↓⍉↑⍵)↑⊃⍵} | ||
lcp 'flowers' 'flow' 'flip' | lcp 'flowers' 'flow' 'flip' | ||
fl | fl |
edits