Mix: Difference between revisions

Jump to navigation Jump to search
2 bytes added ,  06:43, 4 September 2021
fix the longest common prefix error
(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
24

edits

Navigation menu