Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. def uniq (xs: List[Int]): List[Int] =
  2. (xs.foldLeft ((0, empty))
  3. ((acc, x) => (x, if (x != acc._1) x :: acc._2
  4. else acc._2)))
  5. ._2
  6. .reverse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement