Data update
This commit is contained in:
parent
796d366b97
commit
35bcdeebf8
504 changed files with 7045 additions and 610 deletions
|
|
@ -0,0 +1,23 @@
|
|||
func$ lcs a$ b$ .
|
||||
if a$ = "" or b$ = ""
|
||||
return ""
|
||||
.
|
||||
while b$ <> ""
|
||||
for j = len b$ downto 1
|
||||
l$ = substr b$ 1 j
|
||||
for k = 1 to len a$ - j + 1
|
||||
if substr a$ k j = l$
|
||||
if len l$ > len max$
|
||||
max$ = l$
|
||||
.
|
||||
break 2
|
||||
.
|
||||
.
|
||||
.
|
||||
b$ = substr b$ 2 -1
|
||||
.
|
||||
return max$
|
||||
.
|
||||
print lcs "thisisatest" "testing123testing"
|
||||
print lcs "thisisatest" "stesting123testing"
|
||||
print lcs "thisisatestxestinoo" "xxtesting123testing"
|
||||
Loading…
Add table
Add a link
Reference in a new issue