Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open System
- [<EntryPoint>]
- let main argv =
- let rec mem list x =
- match list with
- | [] -> false
- | head :: tail ->
- if x = head then true
- else mem tail x
- let removedupes list1 =
- let rec removeduprec list1 list2 =
- match list1 with
- | [] -> list2
- | head :: tail when mem list2 head = false -> removeduprec tail (list2 @ [head])
- | head :: tail -> removeduprec tail list2
- removeduprec list1 []
- let s = Console.ReadLine()
- printfn "%s" (s |> Seq.toList |> removedupes |> List.toArray |> System.String)
- 0 // return an integer exit code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement