Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
function LCS(a, b)
|
||||
if length(a) = 0 or length(b) = 0 then return ""
|
||||
if right(a, 1) = right(b, 1) then
|
||||
LCS = LCS(left(a, length(a) - 1), left(b, length(b) - 1)) + right(a, 1)
|
||||
else
|
||||
x = LCS(a, left(b, length(b) - 1))
|
||||
y = LCS(left(a, length(a) - 1), b)
|
||||
if length(x) > length(y) then return x else return y
|
||||
end if
|
||||
end function
|
||||
|
||||
print LCS("1234", "1224533324")
|
||||
print LCS("thisisatest", "testing123testing")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue