- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRepeted.java
More file actions
Latest commit
21 lines (18 loc) · 556 Bytes
/
Copy pathRepeted.java
File metadata and controls
21 lines (18 loc) · 556 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
importjava.util.Arrays;
publicclassRepeted {
staticvoidcheck(String[] arr){
for(inti=0; i<arr.length; i++){
for(intj=i+1; j<arr.length; j++){
if(!(arr[i].equals(arr[j]))){
// System.out.println(arr[i]);
arr[j] = "0";
}
}
}
System.out.println(Arrays.toString(arr));
}
publicstaticvoidmain(String[] args) {
String[] arr = {"Facebook","Google","Facebook"};
check(arr);
}
}