https://kotlinlang.org logo
#codereview
Title
# codereview
k

KV

02/26/2021, 2:00 PM
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

Timmy

02/26/2021, 2:06 PM
I would convert one to a mutable set and then use retainAll.
k

KV

02/26/2021, 2:09 PM
okay thanks checking
m

Milan Hruban

02/26/2021, 7:17 PM
if you convert to set, you can use
intersects
j

Joel

02/26/2021, 11:12 PM
Sets will remove duplicates, if that is important
3 Views