Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def uniq (xs: List[Int]): List[Int] =
- (xs.foldLeft ((0, empty))
- ((acc, x) => (x, if (x != acc._1) x :: acc._2
- else acc._2)))
- ._2
- .reverse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement