Longest common substring: Difference between revisions

m
m (→‎{{header|Phix}}: added syntax colouring the hard way)
Line 363:
if x=y [
if? or? i=0 j=0 ->
set lengths \ [i ]\[j]: 0
else ->
set lengths \ [i ]\[j]: (1 + (lengths \ [i-1) ]\ [j-1)]
 
if greatestLength < (lengths \ [i) ]\ [j] [
greatestLength: (lengths \ [i) ]\ [j]
result: slice a (i-greatestLength)+1 i
]
1,532

edits