-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.java
More file actions
33 lines (29 loc) · 781 Bytes
/
test.java
File metadata and controls
33 lines (29 loc) · 781 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
33
package Testing;
import java.util.HashSet;
public class test {
public static void main(String[] args) {
String str = "reetikaaa";
boolean found = false;
int count = 0;
for(int i = 0; i <str.length();i++)
{
found = false;
char c = str.charAt(i);
for(int j =0; j <str.length(); j++)
{
if(c == str.charAt(j) && j!=i)
{
found = true;
break;
}
}
if(found)
{
count++;
if(count > 1) {
System.out.println(c);
}
}
}
}
}