Skip to main content
added 100 characters in body
Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115

Haskell, 33 bytes

nub.((\\)<*>nub)
import Data.List

Try it online! Port of my Husk answer.

The point-free version given above is equivalent to f x=nub$x\\nub x which is one byte longer.


Haskell, 50 bytes

([]#)
a#(x:r)=([x|any(==x)r,all(/=x)a]++a)#r
a#_=a

Try it online! Alternative without imports.

Haskell, 33 bytes

nub.((\\)<*>nub)
import Data.List

Try it online! Port of my Husk answer.


Haskell, 50 bytes

([]#)
a#(x:r)=([x|any(==x)r,all(/=x)a]++a)#r
a#_=a

Try it online! Alternative without imports.

Haskell, 33 bytes

nub.((\\)<*>nub)
import Data.List

Try it online! Port of my Husk answer.

The point-free version given above is equivalent to f x=nub$x\\nub x which is one byte longer.


Haskell, 50 bytes

([]#)
a#(x:r)=([x|any(==x)r,all(/=x)a]++a)#r
a#_=a

Try it online! Alternative without imports.

Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115

Haskell, 33 bytes

nub.((\\)<*>nub)
import Data.List

Try it online! Port of my Husk answer.


Haskell, 50 bytes

([]#)
a#(x:r)=([x|any(==x)r,all(/=x)a]++a)#r
a#_=a

Try it online! Alternative without imports.