Add tags

Add tags to the following comment

まぁ、効率は良くない.。

1
2
3
4
5
6
7
8
val xs = [3, 1, 4, 1, 5, 9, 2, 6, 5]

fun uniq [] = []
  | uniq (x::xs) =
  if List.exists (fn y => y = x) xs then uniq (List.filter (fn z => z <> x) xs)
  else x :: uniq xs

val _ = uniq xs

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...