Advertisement
Guest User

Untitled

a guest
May 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.17 KB | None | 0 0
  1.   def fcompress[T](xs:List[T]):List[T] = {
  2.     return xs.foldRight(List[T]()) {
  3.         case (x, acc) if acc.contains(x) => acc
  4.         case (x, acc) => x::acc
  5.     }
  6.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement