You can use Enum.frequencies/1
to calculate how many of each element there are, and then only take items that appear once:
[1, 1, 2, 3, 3, 4, 5]
|> Enum.frequencies()
|> Enum.filter(&match?({_, 1}, &1))
|> Enum.map(&elem(&1, 0))
Or, from the linked question, you can use the rather obscure:
list = [1, 1, 2, 3, 3, 4, 5]
uniq = Enum.uniq(list)
uniq -- list -- uniq
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…