/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main
(String[] args
) { String[] a
= {"teste1",
"teste2",
"teste1"}; for(int i = 0; i < a.length; i++) {
if(arrayNaoContemString(b, a[i])) {
b[i] = a[i];
}
}
}
}
public static boolean arrayNaoContemString
(String[] array,
String string
){ if (string.equals(s)){
return false;
}
}
return true;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCQlTdHJpbmdbXSBhID0geyJ0ZXN0ZTEiLCAidGVzdGUyIiwgInRlc3RlMSJ9OwoJCVN0cmluZ1tdIGIgPSBuZXcgU3RyaW5nW2EubGVuZ3RoXTsKCQlmb3IoaW50IGkgPSAwOyBpIDwgYS5sZW5ndGg7IGkrKykgewoJCQlpZihhcnJheU5hb0NvbnRlbVN0cmluZyhiLCBhW2ldKSkgewoJCQkJYltpXSA9IGFbaV07IAoJCQl9CgkJfQoJCWZvciAoU3RyaW5nIHN0cmluZyA6IGIpIHsKCQkJU3lzdGVtLm91dC5wcmludGxuKHN0cmluZyk7CgkJfQoJfQoJCglwdWJsaWMgc3RhdGljIGJvb2xlYW4gYXJyYXlOYW9Db250ZW1TdHJpbmcoU3RyaW5nW10gYXJyYXksIFN0cmluZyBzdHJpbmcpewoJICAgZm9yKFN0cmluZyBzIDogYXJyYXkpewoJICAgICAgIGlmIChzdHJpbmcuZXF1YWxzKHMpKXsKCSAgICAgICAgICAgcmV0dXJuIGZhbHNlOwoJICAgICAgIH0KCSAgIH0KCSAgIHJldHVybiB0cnVlOwoJfQp9