Mix: Difference between revisions

Jump to navigation Jump to search
(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
Retrieved from ‘https://aplwiki.com/wiki/Mix