ether #456(2007/07/10 09:20 GMT) [ OCaml ] Rating0/0=0.00
# uniq [3; 1; 4; 1; 5; 9; 2; 6; 5; 3; 5; 8; 9; 7; 9];; - : int list = [3; 1; 4; 5; 9; 2; 6; 8; 7]
1 2 3 4 5 6 7
let uniq xs = let rec uniq' acc = function | [] -> acc | y::ys when (List.mem y acc) -> uniq' acc ys | y::ys -> uniq' (y::acc) ys in List.rev (uniq' [] xs)
Rating0/0=0.00-0+
1 reply [ reply ]
ether
#456()
[
OCaml
]
Rating0/0=0.00
Rating0/0=0.00-0+
1 reply [ reply ]