what is the best way to find the common element fr...
# codereview
k
what is the best way to find the common element from the character array? Suppose I have 2 character array and both arrays have some common characters. How to find those characters?
t
I would convert one to a mutable set and then use retainAll.
k
okay thanks checking
m
if you convert to set, you can use
intersects
j
Sets will remove duplicates, if that is important