-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray44.java
More file actions
32 lines (26 loc) · 691 Bytes
/
Array44.java
File metadata and controls
32 lines (26 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package array;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Name -> Array44
* Copyright © : 6/24/2022
*/
public class Array44 {
public static void main(String[] args) {
solution(new int[]{3,4,3,7,4});
}
//3,4,3,7,7;
//3,3;
public static void solution(int[]arrey) {
int index1,index2;
for(int i=0; i<arrey.length; i++){//i0=5....i9=6
for (int j = i+1; j < arrey.length; j++) {
if(arrey[i]==arrey[j]) {
index1=i;//i0
index2=j;//i2 i4
System.out.print(index1+"->"+index2+";");
}
}
}
}
}