Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
open System
|
||||
|
||||
let longest xs ys = if List.length xs > List.length ys then xs else ys
|
||||
|
||||
let rec lcs a b =
|
||||
match a, b with
|
||||
| [], _
|
||||
| _, [] -> []
|
||||
| x::xs, y::ys ->
|
||||
if x = y then
|
||||
x :: lcs xs ys
|
||||
else
|
||||
longest (lcs a ys) (lcs xs b)
|
||||
|
||||
[<EntryPoint>]
|
||||
let main argv =
|
||||
let split (str:string) = List.init str.Length (fun i -> str.[i])
|
||||
printfn "%A" (String.Join("",
|
||||
(lcs (split "thisisatest") (split "testing123testing"))))
|
||||
0
|
||||
Loading…
Add table
Add a link
Reference in a new issue