efficient way of finding repeated elements in string java code example
Example: find repeated elements in array java
for (String name : names) {
if (set.add(name) == false) {
// your duplicate element
}
}
for (String name : names) {
if (set.add(name) == false) {
// your duplicate element
}
}