I have an `ArrayList<Int>`, is there any stl...
# announcements
e
I have an
ArrayList<Int>
, is there any stlib to get rid of duplicated elements?
p
Not that I'm aware of but you can write a simple extension function that turns it to a set and back (there are no duplicates in a set)
p
@droidrcc’s
distinct
is even better 🙂
d
.toSet()
is an alternative
🙂
e
thanks both
👍 1