Skip to content

Commit 605789b

Browse files
committed
Create problem11.java
1 parent 43aabe3 commit 605789b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

problem11.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
SOlved by Mohammed Azarudeen K, CSE
3+
*/
4+
5+
import java.io.*;
6+
7+
import java.util.*;
8+
9+
public class FindFirstNonRepeatedCharacter {
10+
11+
public static void main(String[] args) {
12+
13+
char name[] = "repeated".toCharArray();
14+
15+
for (int i = 0; i < name.length; i++) {
16+
17+
boolean uniqueChar = true;
18+
19+
for (int j = 0; j < name.length; j++) {
20+
21+
if (i != j && name[i] == name[j]) {
22+
23+
uniqueChar = false;
24+
25+
break;
26+
27+
}
28+
29+
}
30+
31+
if (uniqueChar) {
32+
33+
System.out.println(name[i]);
34+
35+
break;
36+
37+
}
38+
39+
}
40+
41+
}
42+
43+
}

0 commit comments

Comments
 (0)